This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: sstream (probably revisited)
- To: jacob smith <nilrem235 at hotmail dot com>
- Subject: Re: sstream (probably revisited)
- From: Benjamin Kosnik <bkoz at redhat dot com>
- Date: Thu, 23 Aug 2001 11:37:09 -0700 (PDT)
- cc: libstdc++ at gcc dot gnu dot org
Um. If possible, please post in plain text.
The following fixed code works as you expect:
//#include <strstream>
#include <sstream>
#include <iostream>
int main()
{
// std::ostringstream oss;
std::stringstream oss;
std::string s = "1235";
oss << s;
long l = 0;
oss >> l; // xxx no operator >> long for ostream
std::cout << l << std::endl;
return 0;
}
// should output: 1235
// current output: 0