Page 1 of 1

End of Line in C/C++

Posted: Mon Jan 05, 2004 10:14 am
by Verdan
Can you tell me, how can I check if there is EOLN (End Of LiNe (like in Pascal)) while reading from input.

Something like:
While Not EOLN(input) do

Posted: Tue Jan 06, 2004 12:55 am
by Krzysztof Duleba
For instance, you can save the line in a string and then parse it. All you need is to include <string> and <iostream> and then write
[cpp]string line;
If you want to parse with a stringstream, add
[cpp]#include <sstream>[/cpp]

An easy way

Posted: Thu Jan 08, 2004 7:12 am
by Miguel Angel
while (cin.peek()!='\n')

Posted: Fri Feb 20, 2004 12:06 pm
by Verdan
Thank you very much!