This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]