tomtetlaw, That looks spot on
These days, it might be better to use the security enhanced version: sprintf_s
That's up to you though.
Juggalo, you could do something like this for example:
[note: untested code]
char *txt;
txt = new char[256];
char *myName;
myName = new char[256];
// declared in your initialization section
int myHP = 100;
int myMana = 80;
int myLevel = 20;
sprintf(myName, "Lord Doggy");
.
.
.
// somewhere in your main loop
sprintf(txt,"Name: %s, Hit Points: %d, Mana Points: %d, Level: %d", myName, myHP, myMana, myLevel);
dbText(10,10,txt);
.
.
.
// delete used memory before you shutdown your program
delete [] myName;
delete [] txt;