设为首页 加入收藏

TOP

swprintf和sprintf的使用
2014-11-24 00:36:28 来源: 作者: 【 】 浏览:20
Tags:swprintf sprintf 使用

C/C++ code

char szA[100]; //An ANSI string buffer
WCHAR szW[100]; //A Unicode string buffer

//Normal sprintf:all strings are ANSI
sprintf(szA, "%s","ANSI Str");

//Converts Unicode string to ANSI
sprintf(szA,"%S",L"Unicode Str");

//Normal swprintf:all strings are Unicode
swprintf(szW,L"%s",L"Unicode Str");

//Converts ANSI string to Unicode
swprintf(szW,L"%S", "ANSI Str");


摘自 宋金时的专栏
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Hough变换――Opencv版本 下一篇用数组去实现队列(c)

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: