I didn't know that, but when running a command line that has a glob character , such as * or ?, the command line interpreter first expands the character and only then run the program.
For example, if your program is:
#include <stdio.h>
int main (int argc, char ** argv){
int i;
printf ("argc=%d\n",argc);
for (i=0;i<argc;i++){
printf("%d: %s\n",i,argv[i]);
}
}
and you run it like so:
./a.out *
, then the output will be:
argc=4
0: ./a.out
1: a.c
2: a.c~
3: a.out
Of course, the output will depend on the content of the current directory.