c++ - "unsigned int"是否被视为一种数据类型?

标签 c++ c

如果我有:

unsigned int i;

unsigned int 本身是否被视为一种数据类型,就像 intfloat 是一种数据类型一样?或者我们只是说 int 是数据类型,而 unsigned 只是修改数据类型的工作方式?

最佳答案

C++ 标准 §3.9.1,第 2-3 段:(C 类似)

  1. There are five standard signed integer types : “signed char”, “short int”, “int”, “long int”, and “long long int”…
  2. For each of the standard signed integer types, there exists a corresponding (but different) standard unsigned integer type: “unsigned char”, “unsigned short int”, “unsigned int”, “unsigned long int”, and “unsigned long long int”…

关于c++ - "unsigned int"是否被视为一种数据类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27465728/

相关文章:

在嵌套匿名结构上忽略 C++ 私有(private)修饰符

c++ - 光线追踪阴影错误

c++ - 函数指针 : is the simple canonical use bad from a performance point of view? 如果是的话,c++11-ish 的替代方案是什么?

c - 函数返回 long long unsigned int 的返回值不正确

android - 如何用Android.mk编译Cmake文件?

c++ - 从派生类返回值到基类

c - fscanf 失败 [^,]

c - 如何水平显示我的二叉树?

c - 在队列的关键部分使用二进制信号量而不是互斥锁进行互斥有什么好处吗?

c - 函数中的段错误