Click here to Skip to main content
15,914,642 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
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 !
Posted

1 solution

Give it a try by using wprintf() or _tprintf(). Format string should also be wide for these functions.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 5-Mar-11 20:09pm    
Don't you think that also a console should be switched to wide mode, otherwise your function will work but the output will not be right for Unicode code points beyond ANSI?
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900