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]

continuing woes with iostream



Hi, I reported having trouble with the following program, which
has been fixed (mostly).  It does indeed copy input to output correctly
now, although there are leading "^@" symbols before the actual file data is read.
Is the index into the internal array pointing to the wrong space?

#include <iostream>
int main()
{
  char c;
  while(std::cin.get(c)) {
    std::cout << "Got: '";
    std::cout.put(c);
    std::cout << "'" << std::endl; }
  return 0;
}

Output:
Got: '^@'
... many such lines ...
Got: '#'
Got: 'i'
Got: 'n'
Got: 'c'
Got: 'l'
Got: 'u'
Got: 'd'
Got: 'e'
... etc ...

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]