加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

64位整数和较旧的C编译器

发布时间:2020-12-16 05:00:21 所属栏目:百科 来源:网络整理
导读:我想在我的C代码中使用64位整数.我知道我可以#include cstdint然后声明一个uint64_t或使用unsigned long long(或等效的signed signed). 但是,似乎在C 11之前没有添加对此的支持,我希望我的代码与没有完全C 11支持的编译器兼容. 什么是在C中支持64位整数的便
我想在我的C代码中使用64位整数.我知道我可以#include< cstdint>然后声明一个uint64_t或使用unsigned long long(或等效的signed signed).

但是,似乎在C 11之前没有添加对此的支持,我希望我的代码与没有完全C 11支持的编译器兼容.

什么是在C中支持64位整数的便携方式?

解决方法

uint64_t是:

Optional: These typedefs are not defined if no types with such
characteristics exist.

正如你在ref中读到的那样.

从Should I use long long or int64_t for portable code?开始:

The types long long and unsigned long long are standard C and standard C++ types each with at least 64 bits. All compilers I’m aware of provide these types,except possibly when in a -pedantic mode but in this case int64_t or uint64_t won’t be available with pre-C++ 2011 compilers,either. “

g / clang支持long long / int64_t的日期是什么?

Since 07002 (aka 07003).

正如Davidálvarez所说.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读