windows 平台下C/C++ 64位整形数输出
2008-11-24 15:58
399 查看
vc6中long long类型不能识别,64位整形只能用_int64表示。
格式输出时采用%I64d,%I64o, %I64x,,%I64u分别输出十进制、八进制、十六进制和无符号的整数。
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
void main(){
char queryText[100];
_int64 ll = 0xfffffffffffffff;
int l = 0xffffffff;
int t = ll/l;
sprintf(queryText,"ddd%s%I64x", "ttt",ll);
cout<<queryText<<endl;
cout<<sizeof(_int64)<<endl;
}
格式输出时采用%I64d,%I64o, %I64x,,%I64u分别输出十进制、八进制、十六进制和无符号的整数。
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
void main(){
char queryText[100];
_int64 ll = 0xfffffffffffffff;
int l = 0xffffffff;
int t = ll/l;
sprintf(queryText,"ddd%s%I64x", "ttt",ll);
cout<<queryText<<endl;
cout<<sizeof(_int64)<<endl;
}
相关文章推荐
- c/c++输出64位整形值
- windows平台上向64位移植c/c++的变量类型大小变化
- 64位和32位平台下C/C++结构内存对齐
- windows平台下用eclispe进行c/c++开发
- Windows平台安装最新OpenCV-2.4.9,利用Eclipse、MinGW构建C++调用OpenCV开发环境
- Windows平台安装最新OpenCV-2.4.9,利用Eclipse、MinGW构建C++调用OpenCV开发环境
- Windows平台下C++插件系统实现的几个关键技术问题及其解决思路
- 手把手教你写Windows 64位平台调试器
- Windows平台下GCC编程之反向输出整数
- windows 64位技术--C/C++的64位移植
- windows平台下Gearman的一个Worker和Client实例,C++实现
- 在Windows下用Eclipse+CDT+MinGW搭建C++开发平台
- Windows平台下多线程编程基础(C++)
- 如何在Windows平台使用VS搭建C++/Lua的开发环境
- 不可或缺 Windows Native (13) - C++: 标准输入, 标准输出, 字符串内存流
- windows平台下,c++获取cpu型号,读取注册表获取系统软硬件信息代码
- windows平台下 c/c++进行http通信的教训
- 【收藏】64位平台C/C++开发注意事项
- 使用C++实现一款Windows平台上的小型FTP服务器
- 100个windows平台C++开发错误之十六宏定义