c++ - 不同整数类型之间的区别

标签 c++ c

我想知道 uint32_tuint32 之间有什么区别,当我查看头文件时,它有这个:

types.h:

    /** @brief 32-bit unsigned integer. */
    typedef unsigned int uint32;
stdint.h:

    typedef unsigned   uint32_t;

这只会导致更多问题: 有什么区别

unsigned varName;

unsigned int varName;

?

我正在使用 MinGW。

最佳答案

unsignedunsigned int 是同义词,很像 unsigned short [int]unsigned long [int].

uint32_t 是一种(可选地)由 C 标准定义的类型。 uint32 只是你编的一个名字,虽然它恰好被定义为同一个东西。

关于c++ - 不同整数类型之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11786113/

相关文章:

c++ - 如何实现嵌套流畅的接口(interface)?

c++ - 为什么在使用大括号初始值设定项列表时首选 std::initializer_list 构造函数?

c++ - 游戏引擎 C++ 和 Objective-C/Xcode 编码

c - 金字塔分割 OpenCV

c - switch 与 while 增量和评估之间的区别

c++ - 转换 .wav 文件中的 RTP 序列负载

c++ - 在类中的定义之前解析声明

c - 仅使用 while 和 if 对数组进行排序

c - 微 Controller 编程要学什么语言?

python - 将 Cython 中的 numpy 数组传递给需要动态分配数组的 C 函数