Article View: gnu.g++.lib.bug
Article #38strstream bug in libg++-2.0
From: 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
-----------------'-------------------'-----------------------------------------
Technical Details
Message-ID:
<MNL.92Apr8105426@mnlsun.idtsun.e-technik.th-darmstadt.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!idtsun.e-technik.TH-darmstadt.DE!mnlShow Full Headers
Complete Article Headers
Newsgroups: gnu.g++.lib.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!idtsun.e-technik.TH-darmstadt.DE!mnl From: mnl@idtsun.e-technik.TH-darmstadt.DE (Michael N. Lipp) Subject: strstream bug in libg++-2.0 Message-ID: <MNL.92Apr8105426@mnlsun.idtsun.e-technik.th-darmstadt.de> Sender: gnulists@ai.mit.edu Organization: TH-Darmstadt Distribution: gnu Date: Wed, 8 Apr 1992 10:54:26 GMT Approved: bug-lib-g++@prep.ai.mit.edu Lines: 38