I have a function like this:
void drawString (const char *s) //How do display text
{
unsigned int i;
for (i = 0; i < strlen (s); i++)
glutBitmapCharacter (GLUT_BITMAP_HELVETICA_18, s);
};
and i want to call a function like this:
[source lange="cpp"]
drawString("Health"); //this line works just fine
drawString(player1.getHealth()+""); //player1.getHealth() returns an int
thats not possible because it says that i can't convert a const char to a char. How do i solve this problem? I tried different combinations of casting and maybe changing the drawString parameter but nothing seems to work. the function doesn't like me. :( why?
BTW, thanks for putting up with all my questions. I know sometimes i ask a lot. :)