Problem with strstream

Alexandre Oliva
Sat Oct 31 15:24:00 GMT 1998

On Oct 15, 1998, Sanjay Bhatnagar <> wrote:

>      #include <strstream.h>

Note that strstream is non-standard.  stringstream is the standard
version of what you want, but it's not implemented in libstdc++ yet

>          strstream s;
>          printf("%s\n",s.str());

> As far as I can say, this should work.

Not according to the documentation of strstream that is distributed
within libio.  It says:

 - Method: char* ostrstream::str ()
     A pointer to the string managed by this `ostrstream'.  Implies

     Note that if you want the string to be nul-terminated, you must do
     that yourself (perhaps by writing ends to the stream).

Unfortunately, it looks like it is not installed by default.
Shouldn't it be?  It seems to me that just adding to the 
list of dependencies of all: should do it...  May I install this change?

Alexandre Oliva
Universidade Estadual de Campinas, SP, Brasil

More information about the Gcc-bugs mailing list