Page 1 of 1

reading until EOF

Posted: Fri May 10, 2013 11:45 pm
by Spartan
how can i read until EOF using cin, or any other way different than while( scanf("%s", cadena)!= EOF ). The objective is to use the string of the class string and read with iostream.

Re: reading until EOF

Posted: Sat May 11, 2013 12:00 am
by ymondelo20
while( cin>>dato )
{
//Do something ...
}

or

while( gets ( line ) )
{
//Do something ...
}