c中未签名整数的类型是什么
what is the type of unsigned integers in c?
uint8可以表示为ubyte,uint16可以表示为u word,uint32可以表示为ulong,uint64可以表示为?
我正在搜索如何将未签名的整数表示为C中的数据类型,但我对如何呈现UINT64感到困惑?是否可以将UINT64用作C中的UINT64?请有人引导我?它会支持吗?
上述所有格式的指定符是什么?
我只是在添加这一行,因为它要求身体不符合要求并告诉添加一些内容。所以我添加了。
所有这些类型uint8,uint16,uint32,uint64不是标准的基本类型,它们是typedef名称或实现定义的类型
至于uint64,可以将其定义为
typedef unsigned long long uint64;
考虑到已定义了积分类型的大小。因此,在上面的定义中可能足以使用unsigned long
,因为在某些平台上sizeof( unsigned long)
可以等于8个字节。
如果要使用不依赖二手平台的标准积分类型,则应包括标题<cstdint>
与其他定义类型中有以下未签名类型定义
typedef unsigned integer type uint8_t; // optional
typedef unsigned integer type uint16_t; // optional
typedef unsigned integer type uint32_t; // optional
typedef unsigned integer type uint64_t; // optional
typedef unsigned integer type uint_fast8_t;
typedef unsigned integer type uint_fast16_t;
typedef unsigned integer type uint_fast32_t;
typedef unsigned integer type uint_fast64_t;
typedef unsigned integer type uint_least8_t;
typedef unsigned integer type uint_least16_t;
typedef unsigned integer type uint_least32_t;
typedef unsigned integer type uint_least64_t;
#include <stdint.h>
获取在全局名称空间中定义的所有类型。
#include <cstdint>
在命名空间std
中定义它。
在我的实施中,即在stdint.h
中我可以找到:
#if __WORDSIZE == 64
typedef unsigned long int uint64_t;
#else
__extension__
typedef unsigned long long int uint64_t;
#endif
和uint32_t
:
#ifndef __uint32_t_defined
typedef unsigned int uint32_t;
# define __uint32_t_defined
#endif
相关文章:
- 标准 N3337 5.2.10 第 7 条中的C++"类型"是什么意思?
- 如何声明一个标准::提升直方图的向量?提升直方图的类型是什么?
- 类名后跟括号的类型是什么
- std::chrono::duration::count函数的实际结果类型是什么
- c++运算符重载-我实际返回的操作数类型是什么
- 运算符和返回类型是什么意思?
- 指向 2D 数组的指针的类型是什么?
- RSA_verify中预期的数据类型是什么,无法验证从 Java 生成的签名
- 共享_ptr中多功能数组的类型是什么
- 构造函数的类型是什么?
- 字符串中单个字符作为数组的数据类型是什么
- 该结构继承的类型是什么
- 如果我获得Integer和Double的产品,输出的数据类型是什么
- C 中被视为可可的类型是什么
- 当函数采用右值引用时,函数中该变量的类型是什么?
- STD :: SETW,STD :: SETFILL等的真实返回类型是什么?
- 模板类中引用的引用的类型是什么
- const自动参考绑定到(NULL)指针 - 实际类型是什么
- 包含通过引用捕获的 lambda 函数的"variable"的类型是什么?
- 通过插座发送的内容的数据类型是什么