wsprintf swprintf重要区别(转)


标签:
it |
分类: 程序 |
对于wsprintf
对于该函数的使用方法,我在这里就不赘述了,我在这里只讲讲他们的之间最重要的区别在于:
swprintf()函数格式化字符串可以格式化浮点型,而wsprintf()不能。
举例说明:
-
WCHAR
buf; -
buf1[128];
-
buf2[128];
-
float
version = 3.0; -
-
wsprintf(buf1,
"feiyinzilgdV %.2f" ,version); -
swprintf(buf2,
"feiyinzilgdV %.2f" ,version); -
-
可见,wsprintf()是无法格式化浮点型数据的。
转换字符
Example
|
|
Output:
The half of 80 is 40, and the half of that is 20. |
http://hi.csdn.net/attachment/201005/27/0_1274924672T8sl.gifswprintf重要区别(转)" />
http://hi.csdn.net/attachment/201005/27/0_12749246747pJr.gifswprintf重要区别(转)" />