Page 1 of 1

Reading a blank line in c++

Posted: Thu Jul 05, 2007 5:46 pm
by jongooni
I'm trying to read a blank line for the problem 10033 Interpreter (I've searched and didn't find anything too helpful).
The code i have right now is a simple whle loop like this:
cin >> j;
while(j != '\n'){
//<code>
cin>>j;
}//end while

but it doesn't seem to work.

I'm a recent convert from Java, so I can't figure out whats wrong.
Any help would be appreciated.

Posted: Thu Jul 05, 2007 8:46 pm
by hamedv
goto cplusplus.com and learn cin.getline()