This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Problems with stringstream
- From: "Jessee, Mark" <Mark dot Jessee at gdcanada dot com>
- To: "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Fri, 25 Oct 2002 10:10:15 -0600
- Subject: Problems with stringstream
Hi,
I'm trying to build the following program using gcc 3.0.3. It compiles okay
but when it runs there is no output. When I compile and run on MS Visual
C++ the output is "Sample string" as expected. I did a quick check of the
FAQ for this topic but couldn't find any information. Any suggestions are
appreciated!
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main ()
{
stringstream oss;
string mystr;
oss << "Sample string";
mystr=oss.str();
cout << mystr;
return 0;
}
Thanks,
Mark