int i1;
std::istringstream z(argv[1]);
z >> i1;
cout << i1;
z.str(argv[2]);
int i2;
z >> i2;
cout << i2;
This is my code. My first argument is 123, and the second argument is 12. I expect the result to be 12312. Instead, I see 1234196880. Why? I thought that with the str method, could I reset pass the stream to the second argument and read it?
source
share