Thread View: gnu.g++.lib.bug
1 messages
1 total messages
Started by Michael N. Lipp
Wed, 08 Apr 1992 10:54
strstream bug in libg++-2.0
Author: Michael N. Lipp
Date: Wed, 08 Apr 1992 10:54
Date: Wed, 08 Apr 1992 10:54
37 lines
1647 bytes
1647 bytes
Hi,
the following program
----------------------------------------------------------------------
#include <stream.h>
#include <strstream.h>
main ()
{
istrstream in ("Hello world!\n");
char c;
in.tellg ();
while (in >> c, !in.eof ())
cout << c;
}
----------------------------------------------------------------------
puts out nothing. This is caused by the call to in.tellg(). If this
is ommitted, it works. I have no description of the iostream library,
but it seems to me that tellg() should only report the position of the
get pointer and not change it?
Another thing: If I leave out the in.tellg(), I find that the default
seeting is "skip whitespace" (I get "Helloworld!"). Is this a bug or
a feature?
Michael
--
-----------------,------------------------------,------------------------------
Michael N. Lipp ! Institut fuer Datentechnik ! Phone: 49-6151-163776
! Merckstr. 25 ,----------' Fax: 49-6151-164976
! D-6100 Darmstadt ! E-Mail:
! (Germany) ! mnl@dtro.e-technik.th-darmstadt.de
-----------------'-------------------'-----------------------------------------
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads