I've seen a post something like 2 hours ago about a problem i've met days ago, i'm also looking for an explanation too...
https://stackoverflow.com/questions/25281294/c-cout-float-fail-while-printf-do-the-job
I've encoutered exactly the same behavior with cout, which didn't like float at all ...
I've a seperate threaded-UserInterface, made with openGL, with a callback function attached on a button in my main thread.
class ObjectA//My class
{
private:
float light;
float surface;
float height;
public:
ObjectA();
~ObjectA();
float r_light();
float r_surface();
float r_height();
void render(int x, int y); // Not implemented when bug occured
}
ObjectA::ObjectA(void)
{
light = 0;
surface = 0;
height = 0;
}
float ObjectA::r_light()
{
return this->light;
}
void displayResult(ObjectA * a) //The callback function attached to the UserInterface-button
{
cout << a->r_light() << endl;
}
When I runned it, the program crashed hard, and I had to finish the process manually ... The only solution i had was to replace cout by printf, but I didn't really liked that.
Anyone know why i couldn't cout this value ?