|
From: Ioannis V. <iv...@em...> - 2003-04-02 01:24:34
|
My way of reading a sequence with whitespaces without size limit until a
'\n' character is found:
#include <iostream>
#include <string>
int main()
{
using namespace std;
string s;
=20
while(cin)
{
char c;
cin.get(c);
=09
if(c=3D=3D'\n')
break;
s+=3Dc;
}
}
I know it is low level and I assume that there must be a better way =
(which I
do not know so far).
Ioannis Vranos
=20
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL: http://run.to/noicys
|