|
|
如题,话不多说,看代码:
#include "stdlib.h"
#include "iostream"
#include "wchar.h"
using namespace std;
main()
{
WCHAR strNumber[30];
float fNumber;
fNumber=1.2345;
swprintf(strNumber,L"%f",fNumber);
cout<<strNumber<<endl;
printf("%f",fNumber);
}
输出结果:
002EFAC
1.2345
为什么 “strNumber”中的内容不是“1.2345”呢???
|
|