This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

trouble get istream get()



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
-----------------------------------------------------------------------------

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]