Advertisement

glPrint() and strings

Started by February 24, 2003 07:45 PM
1 comment, last by murdoth99 22 years ago
hmmm pretty easy question for you... I''m using glPrint() from lesson 13 and I want to know how to print C++ style strings. I can get ints/doubles/floats fine using %i/%d/%f. Also when I use %s I can print C style strings (char arrays) easy. When I try string variables I either get nothing or some wierd numbers. I''ve tried typecasting the string to a char * but I get some strange typecasting error. this is what I''ve tried using. char *(mystring) (char *)mystring I''ve included in my files.. Is this one of those problems where one must use a #define or typedef? Is there a special % for STL strings? thanks
mystring.c_str() gives a const char* for this purpose.
Advertisement
wow that was quick

thanks thats perfect, gotta love those string methods

side question:
Is this the only way to do it? I was just looking at the MSDN library, and saw %S. It says its for wide-character string, but what are these?

This topic is closed to new replies.

Advertisement