Advertisement

Printing Numbers

Started by April 18, 2001 04:26 PM
1 comment, last by PyroBoy 23 years, 9 months ago
What''s the best/quickest way to print integers, floats etc. On a window? TextOut takes a string (via a char *) to print. If there''s no other way to print a number, how would I go about appending the characters representing a number (int or float) to the end of a string? Anyone know a good int-to-string or float-to-string conversion function?
  char buffer[10];float f = 1.234;sprintf(buffer, "%f", f);  


Now "buffer" contains the number. You can also use the itoa() function for ints.




-------
Andrew
Advertisement
sweet. thanks!

This topic is closed to new replies.

Advertisement