Reading a blank line in c++

Write here if you have problems with your C++ source code

Moderator: Board moderators

Post Reply
jongooni
New poster
Posts: 4
Joined: Thu Jul 05, 2007 5:43 pm

Reading a blank line in c++

Post 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.
hamedv
Learning poster
Posts: 98
Joined: Mon May 07, 2007 8:30 am

Post by hamedv »

goto cplusplus.com and learn cin.getline()
Post Reply

Return to “C++”