I get it, but it seems that your code gets only a line. Where as I need about a hundred of line worth of numbers. Ant clue on how to tell the compiler that if it reaches a number < 0 , then skip it go to new line?
What do you mean by "numbers". You want the individual digits? I'm not sure what you mean by this:
tell the compiler that if it reaches a number < 0 , then skip it go to new line
Are you referring to negative numbers, the negative sign, white space, what? If all you care about is the digits, just read in a character at a time using
get . Use
isdigit from the
cctype library to check if the character is a digit. If it is, convert the character to an integer and add it to the array. If not, throw the character away. I'm not 100% sure this is what you want.
Reputation Points: 2614
Solved Threads: 687
Posting Expert
Offline 5,375 posts
since Jan 2008