使用TextOut显示整数变量的值 [英] Display value of integer variable using TextOut
本文介绍了使用TextOut显示整数变量的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将整数变量转换为UNICODE文本字符串,以便可以在带有TextOut的窗口中显示?
How can I convert an integer variable to a UNICODE text string so it can be displayed in a window with TextOut ?
    int num = 33;
int num = 33;
    TCHAR显示[] =; _T(" 33")
TCHAR display[] = ;_T("33")
     我想用一个文本字符串变量 显示num的值代替 _T(" 33"),
I would like to use a text string variable showing the value of num in place of _T("33"),
     其中num可以在0到100之间变化。
where num can vary from 0 to 100.
推荐答案
有许多不同的方法可以将整数转换为它的文本表示。 由于您似乎使用以null结尾的C字符串,因此一种方法是使用
_itows_s function
There are many different ways to convert an integer into it's textual representation. Since you appear to be using null-terminated C strings, one way would be to use the _itows_s function
这篇关于使用TextOut显示整数变量的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文