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

前端之家收集整理的这篇文章主要介绍了64位整数和较旧的C编译器前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想在我的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所说.

原文链接:https://www.f2er.com/c/239564.html

猜你在找的C&C++相关文章