Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

How can I print Integers with TextOut?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
4 replies to this topic

#1 kolpo   Members   

122
Like
Likes
Like

Posted 08 August 2001 - 04:05 AM

score=50; TextOut(hDC, 50, 50, ?, sizeof(?));

#2 Scarab0   Members   

122
Like
Likes
Like

Posted 08 August 2001 - 04:13 AM

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

#3 JackNathan   Members   

122
Like
Likes
Like

Posted 08 August 2001 - 04:15 AM

Or:

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


Jack

#4 parklife   Members   

132
Like
Likes
Like

Posted 08 August 2001 - 04:31 AM

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

-

The other one is good when calculating and stuff.



#5 kolpo   Members   

122
Like
Likes
Like

Posted 08 August 2001 - 04:35 AM

thanks, then can I finaly view my score




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.