Problems with stringstream

Jessee, Mark Mark.Jessee@gdcanada.com
Fri Oct 25 09:11:00 GMT 2002


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



More information about the Gcc-help mailing list