www.delorie.com/djgpp/bugs/show.cgi   search  
Bug 000281

When Created: 04/22/1999 12:00:49
Against DJGPP version: 2.02
By whom: wings@datarec.com
Abstract: Non standard behavior of istrstream(const char *)
In The Draft Standard C++ Library by P.J. Plauger, he states

"For a null-terminated string s, you can write:
istrstream strin(s);
The character sequence begins at s and continues up to,
but not including,
the terminating null character that follows."

From my experiments, it seems as though the terminating
null character IS included in strin. Of course, this
book is based on a draft copy of the standard and I
believe that strstream is actually not in the
standard anymore, so this may all be moot.

Workaround added: 04/22/1999 12:00:37
By whom: wings@datarec.com
Obvious work around is to either to use
istrstream strin(s, strlen(s)); // Or some variant.
or just simply check for that null before
doing a check for strin.eof().

Note added: 04/22/1999 12:00:28
By whom: wings@datarec.com
I was wrong about the null value being added to the end of istream. It is something, but not always 0, so probably has nothing to do with that.

Note added: 06/03/1999 03:00:34
By whom: eliz@is.elta.co.il
If at all, this is a bug in libstdc++, not in DJGPP.

Closed on 06/03/1999 03:00:56: Not a DJGPP bug.
By whom: eliz@is.elta.co.il



  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2010   by DJ Delorie     Updated Jul 2010