_ _int64 64位整数
来源:互联网 发布:程序员励志桌面壁纸 编辑:程序博客网 时间:2024/05/16 15:33
【MSVC】http://msdn.microsoft.com/en-us/library/aa261215(v=vs.60).aspx
允许使用64位的整数
使用之前先判断是否支持64位整数
【GGC】_#if defined (_INTEGRAL_MAX_BITS) && \ _INTEGRAL_MAX_BITS >= 64typedef signed __int64 int64;typedef unsigned __int64 uint64;#else#error __int64 type not supported#endif
http://bytes.com/topic/c/answers/214990-defining-int64
I use this in my code#if defined(_MSC_VER) || defined(__BORLANDC__)typedef unsigned __int64 ulong64;typedef signed __int64 long64;#elsetypedef unsigned long long ulong64;typedef signed long long long64;#endifIt works for GCC, MSVC and BorlandC which will cover the vast majority ofplatforms.
The _ _int64 keyword declares a new type, a 64-bit (8-byte) integer. As with the int, short, andlong types, the _ _int64 type has a corresponding unsigned version, so the _ _int64 keyword actually can be used to create two types.
The following code sample shows how to declare two 64-bit integers, one signed and the other unsigned:
__int64 signed_big_int;unsigned __int64 unsigned_big_int;
In the printf family of run-time library functions, the format for optional prefixes includes I64, in addition to F, N, h, l, and L. For example, the following statement includes an example of a valid format string:
printf("%I64d", x);
When manipulating 64-bit integers, no special functions are necessary. Ordinary arithmetic operators and operations behave as expected.
Note Both the Alpha edition and the x86 edition of Visual C++ support the _ _int64 data type. However, the support in the Alpha edition is more complete; in particular, the integrated debugger recognizes _ _int64 variables in the Alpha edition but not in the x86 edition. Also, both editions provide full support for the _ _int8, _ _int16, and _ _int32 types. Use of these types is not recommended, except in situations where the program must interact with a fixed-byte layout (for example, in reading records previously stored on disk).
Use of _ _int64 should be conditional on the predefined macro _INTEGRAL_MAX_BITS. This macro describes the maximum size of integers defined using the form _ _intx. For example:
_#if defined (_INTEGRAL_MAX_BITS) && \ _INTEGRAL_MAX_BITS >= 64typedef signed __int64 int64;typedef unsigned __int64 uint64;#else#error __int64 type not supported#endif
- _ _int64 64位整数
- C++的64位整数(_int64)
- ACM做题C/C++的64位整数(_int64)
- 64位(_int64)与字符串的相互转化
- 大整数_int64及long long
- VS下64位整形数(_int64)与字符串的相互转化
- C++ 64位整数
- 64位整数
- 64位整数
- 笔记--64位整数
- 格式化 64位整数
- 64位整数
- 在单片机中, 64 位整数除以 32 位整数
- 64位中的整数优化
- C++中的64位整数
- C++中的64位整数
- C++的64位整数
- C++的64位整数
- OpenCV学习笔记-图像金字塔
- 知乎收藏问题汇总
- asp.net动态添加文本框并获取内容添加到数据库中
- 服务器选型:x86 vs 小型机谁更胜一筹?
- 获取系统鼠标的个数及屏幕的大小
- _ _int64 64位整数
- 远程桌面打开任务管理器
- 第三篇 光纤色散
- iBATIS学习之简介
- 黑马程序员-java高新技术
- git-merge tools
- 致工贸的孩子们
- hdu/hdoj 1023 Train Problem II
- Javascript base64加密 解密