Powered by |
Usage of argv[0]int main(int argc, char* argv[])
{
return 0;
}
Everybody recognizes this line. In some sources you can find that the Recently I had noticed it is not always true. My statement is the To prove my words you may do the following: compile this snippet. #include "stdafx.h" //or #include "stdio.h"
#include "stdlib.h"
int main(int argc, char* argv[])
{
printf("_pgmptr = %s\n", _pgmptr);
printf("argv[0] = %s\n", argv[0]);
printf("Hello World!\n");
return 0;
}
Place it somewhere on you hard drive. Start cmd. Set current directory to the folder where the file is. Run it by name with extension. Run it by name without extention. Run it by entering full path to the file. Check the output. See that run-time global variable
|