C, reading multiple numbers from single input line (scanf?)
- by michal
Hi,
I'm writing an app in pure C which expects two line at input:
first one, which tells how big an array of int will be,
and the second, which contains values, separated by space.
So, for the following input
5
1 2 3 4 99
I need to create an array containing {1,2,3,4,99}
Now, my question is - what is the fastest (yet easy ;)) way to do so?
My problem is "how to read multiple numbers without looping through the whole string checking if it's space or a number" ?
Thanks
m.