积极答复者
为啥wspintf歧视数字?

问题
-
// wsprintf.cpp : Defines the entry point for the application.
//#include "stdafx.h"
#include "stdio.h"int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
TCHAR szBufferx [100] ;
long length;//length=wsprintf (szBufferx, TEXT ("%5d"),123456789);//这句输出是对的
length=wsprintf (szBufferx, TEXT ("%5d"),13023289560);
//为什么上面这句输出来的值不对呢?
MessageBox (NULL, szBufferx, "szCaption", 0|1) ;
return 0;
}
maiyude
答案
-
length=wsprintf (szBufferx, TEXT ("%5d"),13023289560);
--》
length=wsprintf (szBufferx, TEXT ("%I64d"),13023289560);
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.- 已标记为答案 maiyude 2011年6月15日 4:18
全部回复
-
length=wsprintf (szBufferx, TEXT ("%5d"),13023289560);
--》
length=wsprintf (szBufferx, TEXT ("%I64d"),13023289560);
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.- 已标记为答案 maiyude 2011年6月15日 4:18