开发者

converting PWSTR variable to upper case in vc++

how i can c开发者_运维知识库onvert PWSTR variable to uppercase in vc++. I googled but didn't get the code sample.

EDITED

What i want to do with PWSTR variable is, a method's return type is PWSTR. I have to check whether the returned value is equal to string "Y". so whatever comes from return I am trying to UPPER its case then checking.

One more thing I want to know, how to use PWSTR var in if() condition checking.

thanks


There is _tcsupr_s and friends which should get you in the right direction.

EDIT:

Following on from your edit, you don't need to worry about converting to upper case for you to then do the comparison -- you can instead call the case insensitive string comparison function, _tcsicmp (or its friends if you're not compiling for Unicode) - there is example code if you follow the link, which also explains the importance of having set the correct locale to give the results you're expecting.


There you are - http://msdn.microsoft.com/en-us/library/sch3dy08%28v=VS.80%29.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜