A
Adrian
When I try this on MS C++2005 it takes the bad stream branch, and I
have no idea why. Borland and Gcc both do what I would expect.
Have I done something stupid?
#include <iostream>
#include <string>
#include <sstream>
int main()
{
int x=0;
std::string s("17,17,0,C,TOR,129/143");
std::istringstream strm(s);
strm >> x;
if(strm.good())
{
std::cout << x;
}
else
{
std::cout << "bad stream";
}
return 0;
}
have no idea why. Borland and Gcc both do what I would expect.
Have I done something stupid?
#include <iostream>
#include <string>
#include <sstream>
int main()
{
int x=0;
std::string s("17,17,0,C,TOR,129/143");
std::istringstream strm(s);
strm >> x;
if(strm.good())
{
std::cout << x;
}
else
{
std::cout << "bad stream";
}
return 0;
}