"std::stringstream" unexpected behavior (simple example)
hi Guys,
i'm puzzled by the values i'm getting back from stringstream
Code:
#include <sstream>
#include <iostream>
int main(int argc, char* argv[])
{
std::stringstream ss("1");
int x;
ss >> x;
std::cout <<"(" <<x <<")";
ss.str("1");
int y;
ss >> y;
std::cout <<"(" <<y <<")";
return 0;
}
output is!
i was of course expecting:
it's causing problems in one of my programs.
anyone got an explanation?
(i'm using code::blocks with mingw if that matters)