#include <Windows.h>
#include <stdio.h>void main()
{
LONGLONG l; wchar_t wszBuf[200]; wsprintf(wszBuf,L"%lld",l);
}执行到 wsprintf处就会出错,还请各位帮忙
#include <stdio.h>void main()
{
LONGLONG l; wchar_t wszBuf[200]; wsprintf(wszBuf,L"%lld",l);
}执行到 wsprintf处就会出错,还请各位帮忙
解决方案 »
- 愚人节晚了两天。继续忽悠!Nana C++ Library
- 急急急!!!求msdn2001版.
- 急问treeview中点击某项响应问题
- 求助:MDI中如何手动创建新的文档和视图?
- VC ATL写的COM,选了支持MTS,但是debug编译可通过,release不行,为什么?
- CString
- Socket编程问题:在局域网中,不知道服务器端的IP地址的情况下如何发送信息给服务器?
- 请教一个低级错误!
- 如何判断两个字符串之间的空格数?
- 在vc中有没有限制小数的精确度的函数。就是说在运算中我要知道小数的具体位数!
- debug和release都正常,双击或者cmd执行却出错,可能是什么原因?
- 调试时,机器假死!
#include <stdio.h> void main()
{
LONGLONG l=9;
wchar_t wszBuf[200];
wsprintfW(wszBuf, L"%ld\n", l);
wprintf(wszBuf);
}
over,给分
c Single character. This value is interpreted as type WCHAR if the calling application defines Unicode and as type __wchar_t otherwise.
C Single character. This value is interpreted as type __wchar_t if the calling application defines Unicode and as type WCHAR otherwise.
d Signed decimal integer. This value is equivalent to i.
hc, hC Single character. The wsprintf function ignores character arguments with a numeric value of zero. This value is always interpreted as type __wchar_t, even when the calling application defines Unicode.
hd Signed short integer argument.
hs, hS String. This value is always interpreted as type LPSTR, even when the calling application defines Unicode.
hu Unsigned short integer.
i Signed decimal integer. This value is equivalent to d.
lc, lC Single character. The wsprintf function ignores character arguments with a numeric value of zero. This value is always interpreted as type WCHAR, even when the calling application does not define Unicode.
ld Long signed integer. This value is equivalent to li.
li Long signed integer. This value is equivalent to ld.
ls, lS String. This value is always interpreted as type LPWSTR, even when the calling application does not define Unicode. This value is equivalent to ws.
lu Long unsigned integer.
lx, lX Long unsigned hexadecimal integer in lowercase or uppercase.
p Windows 2000/XP: Pointer. The address is printed using hexadecimal.
s String. This value is interpreted as type LPWSTR when the calling application defines Unicode and as type LPSTR otherwise.
S String. This value is interpreted as type LPSTR when the calling application defines Unicode and as type LPWSTR otherwise.
u Unsigned integer argument.
x, X Unsigned hexadecimal integer in lowercase or uppercase.
#include <stdio.h>void main()
{
LONGLONG l = 100; wchar_t wszBuf[200]; wsprintf(wszBuf,L"%ld",l); wchar_t wstr[50] = L"$MFT";
wchar_t wstr2[50];
wcscpy(wstr2,wstr); //这样会把字符串的空间挤掉?
wsprintf(wszBuf,L"%-20lu %-10ls",l,wstr2);
}为什么wszBuf中没有 wstr2的内容