首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

LONGLONG 转换为CString解决方法

2012-04-06 
LONGLONG 转换为CStringLONGLONGLLValue15618949813004CStringstrstr.Format(_T( %d ),LLValue)结果

LONGLONG 转换为CString
LONGLONG   LLValue=15618949813004;
CString   str;
str.Format(   _T( "%d "),   LLValue   );
结果是str为负值,
LLValue   值小可以。


[解决办法]
%ld?
[解决办法]
这样就可以了:

LONGLONG LLValue=15618949813004;
CString str;
str.Format( _T( "%I64d "), LLValue );

MSDN上有关于CString的详细用法,楼主可以了解详细用法.

[解决办法]
long long i = 15618949813004;
printf( "%I64u ",i);
[解决办法]
LONGLONG LLValue=15618949813004;
CString str;
str.Format( _T( "%I64d "), LLValue );

str.Format( _T( "%d "), LLValue );中d的位数太小,所以转变成负值了
[解决办法]
前32位截下来换成string
后32为截下来换成string
两个string合起来……

热点排行
Bad Request.