User forums > General (but related to Code::Blocks)
istringstream : bug @ MS
killerbot:
I use the MSDN full version.
@Game_ender : what's that stuff about manual patching VS 2005 ???
Game_Ender:
If you have run the above code sample and task manager showed your memory usage growing continusouly then you can use the workaround described here: Microsoft Workaround. I am not sure if they have release any updates for VS 2005 that contain a better fix.
takeshimiya:
If it's a bug in their STL implementation, just use STLPort (of course, that is, if you really like (or need) to use the M$ free compiler).
Michael:
--- Quote from: killerbot on January 31, 2006, 10:39:16 am ---
--- Code: ---#include <string>
#include <sstream>
#include <iostream>
using namespace std;
int main()
{
//string FirstWord("267,45");
string FirstWord("267 , 34"); //This works!!!
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
--- End code ---
--- End quote ---
Hello,
It seems that the problem is with the string. If you use string FirstWord("267 , 34");, it works.
Funny thing :D.
Michael
killerbot:
yes then it works, and if you repalce the , by a . it also works. The string is not the poblem, the instringstream can't handle things right anymore, where it did in .NET 2003. Stupid M$
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version