How can I print Integers with TextOut?

Started by
3 comments, last by kolpo 22 years, 8 months ago
score=50; TextOut(hDC, 50, 50, ?, sizeof(?));
Advertisement
score=50;
char buffer[16]; // Make it large enough to hold any number you want to print

sprintf(buffer, "%i", score);

TextOut(hDC, 50, 50, buffer, sizeof(buffer));

Hope that helps.

Dirk "Scarab" Gerrits

''If knowledge is power, than to be unknown is to be unconquerable.''
- Unknown Romulan Centurion
Dirk =[Scarab]= Gerrits
Or:

char String[16];
int Num = 50;
itoa(Num, String, 10);


Jack
Go with the one Scarab0 made, it''s nicer.

-

The other one is good when calculating and stuff.

thanks, then can I finaly view my score

This topic is closed to new replies.

Advertisement