This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with strstream
- To: Sanjay Bhatnagar <sanjay at ncra dot tifr dot res dot in>
- Subject: Re: Problem with strstream
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 31 Oct 1998 15:46:31 -200
- Cc: egcs-bugs at cygnus dot com, egcs-patches at cygnus dot com
- References: <199810150836.OAA05392@langur.ncra.tifr.res.in>
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