Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

while( !sin.eof() ) does not read white space.

Status
Not open for further replies.

jstreich

Programmer
Apr 20, 2002
1,067
US
Reading into a char *, I can't seem to read in the white space charictor, but it reads untill the EOF... There is what I have...

char ch;
while( !sin.eof() )
{
sin >> ch;
message.push_back(ch);
}

I was thinkinf of perhaps doing a getline, but that would cost me time copying into the vector. Also, '\n' has to be differnt that ' '.
 
Opps, sorry, missed a iomanip function noskipws...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top