Hi guys,
I'm not sure how to word the question so I'll just show an example,
Example:
main 25/3
Now, here's what I want to do. I want to take the three numbers and use them in a switch statement. Here are some codes I've tried,
Code:
sscanf(argv[1], "%d%d/%d", &i, &j, &k);
This code didn't work correctly because when I tried to output the values, I got first number,25, and two garbage numbers.
Code:
sscanf(argv[1], "%d/%d", &i, &j);
This code works, but not in the way I want it to. It gives me 25 and 3.
Is there a way to separate the 2 and 5 so I can use them individually?
Any help is appreciated. Thanks!