Hello all,

How would you go about getting an array of numbers from an input sequence of arbitrary length? i.e. the user can input:
1 -2 3 -4 5 -6 7 -8

I understand dynamic memory allocation, and can think of a way to do this that would involve a lengthy algorithm of looping through and checking for whitespace/(- sign) on either side, but is there a better way to go about it?

thanks!

- iochi