This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: <strstream> vs <sstream>
- From: Igor Markov <imarkov at umich dot edu>
- To: Paolo Carlini <pcarlini at unitus dot it>
- Cc: imarkov at eecs dot umich dot edu, gcc <gcc at gnu dot org>, gcc-help at gnu dot org
- Date: Sat, 31 Aug 2002 15:00:37 -0400
- Subject: Re: <strstream> vs <sstream>
- References: <1030790905.3d709ef955786@www.eecs.umich.edu> <3D70A4AF.5030103@unitus.it>
- Reply-to: imarkov at eecs dot umich dot edu
Paolo,
thanks for the equivalent code,
but it does not seem to compile either
/n/gagarin/z/imarkov/devel/ g++ testS.cxx
testS.cxx: In function `int main()':
testS.cxx:5: `ostrstream' undeclared in namespace `std'
testS.cxx:5: parse error before `(' token
/n/gagarin/z/imarkov/devel/ g++ --version
g++ (GCC) 3.2 20020809 (Debian prerelease)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
/n/gagarin/z/imarkov/devel/ cat testS.cxx
#include <sstream>
//int main() { char buf[10]; std::osstream s(buf,10); }
int main() { std::string buf; std::ostrstream s(buf); }
/n/gagarin/z/imarkov/devel/
Igor
Quoting Paolo Carlini <pcarlini@unitus.it>:
> Igor Markov wrote:
>
> > g++ 3.1.1 and 3.2 ( which I am using on Debian Linux) complain about
> >#include <strstream>
> > and I am having trouble with the suggested replacement
> >#include <sstream>
> >
> The <sstream> equivalent is, roughly:
>
> #include <sstream>
> int main() { std::string buf; std::ostrstream s(buf); }
>
> I suggest perusing §13.11 of Josuttis (ISBN: 0201379260).
>
> Ciao, Paolo.
>
> P.S. Strictly speaking, this list is "... for general development
> discussions...": gcc-help is more appropriate for this kind of questions.
>
>
>
--
Igor Markov (734) 936-7829 EECS 2211
http://www.eecs.umich.edu/~imarkov