-8

C++中的类型unsigned指的是什么?和 完全一样unsigned int吗?

[符合质量标准]

4

2 回答 2

4

是的,完全一样。有关类型说明符和相应指定类型的列表,请参见7.1.6.2 简单类型说明符 [dcl.type.simple]中的表 10。unsigned指定类型“unsigned int”,就像unsigned int指定类型“unsigned int”一样。

Specifier(s)            Type

_type-name_             the type named
_simple-template-id_    the type as defined in 14.2
char                    “char”
unsigned char           “unsigned char”
signed char             “signed char”
char16_t                “char16_t”
char32_t                “char32_t”
bool                    “bool”
unsigned                “unsigned int”       <<<<<<<<<<<<<
unsigned int            “unsigned int”
signed                  “int”
signed int              “int”
int                     “int”
unsigned short int      “unsigned short int”
unsigned short          “unsigned short int”
unsigned long int       “unsigned long int”
unsigned long           “unsigned long int”
unsigned long long int  “unsigned long long int”
unsigned long long      “unsigned long long int”
signed long int         “long int”
signed long             “long int”
signed long long int    “long long int”
signed long long        “long long int”
long long int           “long long int”
long long               “long long int”
long int                “long int”
long                    “long int”
signed short int        “short int”
signed short            “short int”
short int               “short int”
short                   “short int”
wchar_t                 “wchar_t”
float                   “float”
double                  “double”
long double             “long double”
void                    “void”
auto                    placeholder for a type to be deduced
decltype(_expression_)  the type as defined below
于 2012-11-08T21:40:02.823 回答
2

是的,它是一样的。

参考:http ://en.cppreference.com/w/cpp/language/types

于 2012-11-08T21:40:51.763 回答