- #1
whitehorsey
- 192
- 0
I am reading an input file that has blank lines. x reads character by character. x is equal to a new line so it goes into the while loop but skips the if x == '\n'. It's suppose to go inside the if statement but it doesn't. I tried debugging the code and printed out to double check x is holding a new line. What am I doing wrong?
Code:
while(x == ' ' || x== '\n')
{
if(x== ' ')
{
//...
}
if(x== '\n')
{
//...
}
}
Last edited by a moderator: