How to use TextOut

Started by
1 comment, last by kingpinzs 18 years, 8 months ago
How can I have TextOut display int varibles? Or is there another way to display text to a non console window/
Advertisement
You have to store these numbers to a string, then pass the string as a parameter to TextOut(). There are a couple methods of storing integers to strings; the method I'm used to (perhaps not the best) is:
int integer = ...;char buffer[ 200 ];wsprintf( buffer, "I want to display the number %d", integer );

Now, the char array "buffer" contains the string and the integer you want to display in place of "%d". You may want to look up wsprintf() on MSDN for a better explanation. Also note that this function has been "declared deprecated" and replaced by something else (see MSDN for that).
.:<<-v0d[KA]->>:.
Thanks that worked like a charm thanks for the help

This topic is closed to new replies.

Advertisement