I am having really strange issue. I am passing multiple arguments in command line of my Objective-C program via the following commands.
gcc -framework Foundation main.m calculator.m -o prog1
./prog1 3 + 5 / 8
When I print argc
and argv[]
it gives me following output that is correct
argc = 6
argv[] = prog1,3,+,5,/,8
The problem occurs when I insert a "*" in the input: ./prog1 3 + 5 / 8 * 8
Then it gives me really strange output
argc = 12
argv [] = 3,+,5,/,8,calculator.h,calculator.m,main.m,prog1,8
What's going wrong?