Original Post
Okay, I got a function that uses std::string a lot for some operations. This is the function:
bool MyClass::func()
{
std::string buffer;
while( something )
{
buffer = bla bla
// lots of "buffer =" here..
//then in the end of the function I have these lines:
buffer = readLine(fin);
sscanf(buffer.c_str(),"%f %f %f %f", &b->rot.w, &b->rot.x, &b->rot.y, &b->rot.z);
//Break! Here buffer starts to act wierd!
}
}
When it passes that sscanf function, the buffer variable starts to act wierd. No matter what you do with it, all it does is make itself equals "D". I''ve tried a lot of stuff like:
buffer = "asdf";
buffer = szSomeString;
buffer = otherStdString;
buffer = readLine();
buffer.clear();
buffer = std::string("hello world");
Nothing helped.. buffer still equals "D".. :-(
Does anyone know anything about this behaviour?
----------------------------------------------
Petter Nordlander
"There are only 10 kinds of people in the world. They who understand binary and those who do not"