Problem with strstream

Alexandre Oliva oliva@dcc.unicamp.br
Sat Oct 31 15:24:00 GMT 1998


On Oct 15, 1998, Sanjay Bhatnagar <sanjay@ncra.tifr.res.in> 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
     `ostrstream::freeze()'.

     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 iostream.info to the 
list of dependencies of all: should do it...  May I install this change?

-- 
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:oliva@gnu.org mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil




More information about the Gcc-bugs mailing list