Need help with reading numbers from the command line

This is a discussion on Need help with reading numbers from the command line within the C Programming forums, part of the General Programming Boards category; Hi guys,
I'm not sure how to word the question so I'll just show an example,
Example:
main 25/3
Now, ...

How is scanf supposed to know that you want 2 and 5 instead of 25? Unfortunately (really!), computers aren't that bright, so you have to work around things like this. For example, read the first number as a string:

Code:

sscanf(argv[1], "%[^/]/%d", a, &j);

But that introduces other problems, like how many digits are you expecting for the first number? Do you treat each digit as unique, or is some clairvoyance required? If it's the latter then you need to redesign.