Tuesday, 26 April 2016

Write the program to print the executable name

 
C++ interview questions

Use the argv[0] parameter. It  will print the executable name.

#include<iostream>



int main(int argc, char *argv[])

{
   using namespace std;
   printf("\n ");
   printf("\n  :: %s ", argv[0] );
   return 0;

}