How to use TextOut
How can I have TextOut display int varibles?
Or is there another way to display text to a non console window/
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:
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).
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).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement