* performs a global shell. Thus, it will apply to all files in your current directory, which will be the arguments of your program, you have 65 files in your directory. You can see what happens if you run echo *
You need a single quote * , as in ./test '*' (double quotes will work too), this will prevent shell expansion * . A * provided to your program in this case, the shell removes single quotes.
If you want to evaluate expressions, you can do
./test 3 2 '*'
In this case, your program receives 3 additional arguments, separated as follows: argv[1] is 3 , argv[2] is 2 and argv[3] is *
Or you could do:
./test '3 2 *'
In this case, your program receives 1 additional argument, argv[1] will be line 3 2 *
source share