swprintf的用法到底是怎样

[复制链接]
查看11 | 回复2 | 2016-3-17 20:52:33 | 显示全部楼层 |阅读模式
{
float s=5.005;
TCHAR str4[100];
sprintf(str4,"%f",s);
}
这样写是对的但是如果要用swprintf来代替sprintf应该怎么写啊

回复

使用道具 举报

千问 | 2016-3-17 20:52:33 | 显示全部楼层
这是他们的例程 你看看吧Example Copy Code// crt_sprintf.c/* This program uses sprintf to format various * data and place them in the string named buffer. */ #includeint main( void ){ charbuffer[200], s[] = "computer", c = 'l'; int i = 35, j; float fp = 1.7320534f
回复

使用道具 举报

千问 | 2016-3-17 20:52:33 | 显示全部楼层
你这么写str4不是乱码?宽字符应该用swprintf,参数表一样
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行