This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem with strstream


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]