This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
trouble get istream get()
- To: libstdc++@sourceware.cygnus.com
- Subject: trouble get istream get()
- From: dek@cgl.ucsf.edu
- Date: Mon, 26 Jul 1999 15:36:16 -0700
- Cc: bkoz@cygnus.com
- Reply-to: dek@cgl.ucsf.edu
Hi, according to stroustrup, (p 618, I think), the following code should
copy input to output faithfully (including whitespace).
However, with libstdc++ from CVS (as of today), whitespace (both spaces
and newlines) are ignored:
#include <string>
#include <iostream>
int main()
{
char c;
while(cin.get(c))
cout.put(c);
return 0;
}
I didn't look too deeply into the get() implementation, but I didn't see
anything obvious which should skip whitespace...
Dave
-----------------------------------------------------------------------------
Email: dek@cgl.ucsf.edu David Konerding WWW: http://picasso.ucsf.edu/~dek
-----------------------------------------------------------------------------