glPrint(10,10,1,"string is :%s",s);
How do use glPrint() to print a string var
Hey guys
say is I have a std::string s="hello world".
How would I possible to print it using glPrint()
This code doesn't work btw
/*----------------------------------------------------------------------------------------------------------------------------------*/Enthusiastic and wild about game development. Any opportunity would get me sink into any fantastic game-revolution era.
glPrint(10,10,1,"string is :%s",s);
Should be:
glPrint(10,10,1,"string is :%s",s.c_str());
Otherwise you're splattering in the member variables of the string class.
Should be:
glPrint(10,10,1,"string is :%s",s.c_str());
Otherwise you're splattering in the member variables of the string class.
Quote: Original post by Evil Steve
glPrint(10,10,1,"string is :%s",s);
Should be:
glPrint(10,10,1,"string is :%s",s.c_str());
Otherwise you're splattering in the member variables of the string class.
Yes Thanks a lot mate.
/*----------------------------------------------------------------------------------------------------------------------------------*/Enthusiastic and wild about game development. Any opportunity would get me sink into any fantastic game-revolution era.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement