This has nothing to do with C but with your shell. You need to quote * (and other shell special characters) if you want to be able to take them as argument. Otherwise the shell will to substiutions, in particular globbing.
So you need to call your program with:
./myprog 3 '*' 2