Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


How can I print Integers with TextOut?


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   -  Reputation: 122

Like
Likes
Like

Posted 08 August 2001 - 04:05 AM

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

Sponsor:

#2 Scarab0   Members   -  Reputation: 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   -  Reputation: 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   -  Reputation: 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   -  Reputation: 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.



PARTNERS