可视c ++:使用printf%ls的LPCWSTR,仅返回第一个字符 [英] visual c++: LPCWSTR using printf %ls, only comes back with 1st char
本文介绍了可视c ++:使用printf%ls的LPCWSTR,仅返回第一个字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
希望这是问的正确地方.
我有一个使用LPCWSTR的C代码,想要将其打印出来,
请问正确的格式是什么?
%ls仅返回1个字符. :mad:
谢谢!
Hi,
hope this is the right place to ask.
I have a c code using LPCWSTR, want to print it out,
what''s the correct format pls ?
%ls only comes back with 1 character. :mad:
Thanks !
推荐答案
使用wprintf()或_tprintf()尝试一下.这些功能的格式字符串也应该宽.
Give it a try by using wprintf() or _tprintf(). Format string should also be wide for these functions.
这篇关于可视c ++:使用printf%ls的LPCWSTR,仅返回第一个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文