|
-
November 18th, 2010, 06:20 PM
#1
get an array of numbers from an input sequence of arbitrary length
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|