I want an int value to display in screen as a string. This is for a game I am doing in opengl. I have something like this:
char *string = "0"; // to declare
sprintf (label,"%d" ,string); // This prints 0
This works perfect to print the 0 in the screen, however as you might understand I want the 0 to be changing. I tried converting int to string and trying to assign this to the char *string, but i think it is not possible. I am a newbie in C++ so I do not know much about I would much appreciate your help with this. What I want to achieve is this:
char *string = "0"; // to declare
int number = 90; // declare int to be converted;
sprintf (label,"%d" ,string); // This prints 90
I have found converting methods for int to char methods, howevernon have solved my issue. Thank you for all your help in advance.