ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1102. Strange Dialog

EOLN in C++
Posted by AlMag 12 Jun 2007 23:59
In Pascal the End of Line looks like EOLN.
I can write While not Eoln() Begin ... End;
How to make it work in C++?
I want to do smthng like

scanf("%d",&n);
for(; n>0; --n)
{
   while ((c=getc(stdin))!=EOLN) { line[sz]=c; sz++; }
   ...
}
Re: EOLN in C++
Posted by Boris Strandjev 19 Oct 2007 19:45
you should use EOF || '\n' thus you would stop your execution if the line ends or the file ends. It is up to you then to process the to results as they should be.
Re: EOLN in C++
Posted by Rumter (2) 14 Jul 2008 16:06
I used

while ((c = getc (stdin)) != '\n' && c > 0)