Your problem is not in your code. It is in the OS/shell. You see, the *
in the command line expands to the directory contents so the arguments 2 * 3
expands to 2 dir1 dir2 file1, file2, etc...
I suggest you to use someting like "2*3" as an argument and something like sscanf(argv[1], "%d%c%d", &a, &command, &b);