continuing woes with iostream

dek@cgl.ucsf.edu dek@cgl.ucsf.edu
Thu Aug 5 10:52:00 GMT 1999


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


More information about the Libstdc++ mailing list