Very very off topic, in the case I did not do anything wrong, I have found a bug in M$ DevStudio 2005. And off course things work well in Code::Blocks :lol: :lol: :lol: :lol:
#include <string>
#include <sstream>
#include <iostream>
using namespace std;
int main()
{
string FirstWord("267,45");
istringstream iss2(FirstWord);
int x = 0;
iss2 >> x; //<------------------------------ M$ goes wrong here
char Comma = 0;
iss2 >> Comma;
if(Comma != ',')
{
return -1;
}
int y = 0;
iss2 >> y;
cout << x << "," << y << endl;
} // end of main
The code above, fails to read in the integer value into x (.NET 2003 did it OK), the stream even goes in to 'fail' or 'bad' state, since later on even reading a char is no longer possible. (If you start with a char, then you would get the '2').
So, once more, in case I did not do anything wrong, beware of using M$, USE CB.
Excuse me , what did you say --> USE CB. :twisted: :twisted: