__int64
来源:互联网 发布:马云在阿里的影响力 编辑:程序博客网 时间:2024/04/29 18:23
VCVC6.0的64位整数分别叫做__int64与unsigned __int64,其范围分别是[-2^63, 2^63)与[0,2^64),即-9223372036854775808~9223372036854775807(10^19)与0~18446744073709551615(约1800亿亿)(10^20)。对64位整数的运算与32位整数基本相同,都支持四则运算与位运算等。当进行64位与32位的混合运算时,32位整数会被隐式转换成64位整数。但是,VC的输入输出与__int64的兼容就不是很好了,如果你写下这样一段代码:
1 __int64 a;
2 cin >> a;
3 cout << a;
那么,在第2行会收到“error C2679: binary '>>' : no operator defined which takes a right-hand operand of type '__int64' (or there is no acceptable conversion)”的错误;在第3行会收到“error C2593: 'operator <<' is ambiguous”的错误。那是不是就不能进行输入输出呢?当然不是,你可以使用C的写法:
scanf("%I64d",&a);
printf("%I64d",a);
就可以正确输入输出了。当使用unsigned __int64时,把"I64d"改为"I64u"就可以了。
(转自百度百科。。。)
0 0
- __int64
- __int64
- __int64
- 有关__int64
- double __int64
- vc __int64
- __int64用法
- 关于__int64
- 关于__int64
- __int64 longlong
- __int64,int
- __int64内存布局
- __int64的printf问题
- LONGLONG, __int64如何输入输出
- C++ __int64用法
- C 中 __int64用法
- 正确使用__int64
- __int64的一些用法
- 【SQL server】 数据类型
- 黑马程序员 浅看OC中Category 分类\类别
- POJ 2533 Longest Ordered Subsequence
- Yarn源代码分析之旅---ResourceManager---用户交互之ResourceManagerAdministrationProtocol与AdminService
- Javascript算法系列之快速排序(Quicksort)
- __int64
- 编程基础——第五单元 函数
- Git安装使用指南与Github远程仓库
- 深入浅出聊Unity3D项目优化:从Draw Calls到GC
- Mysql 读写分离实现及代理Amoeba的使用
- 关于使用Restlet的升级
- Android中的LruCache缓存技术
- [Leetcode]127. Word Ladder@python
- annotaton之@SuppressWarning