The signed / unsigned part of the base type or it is a classifier

The Wiki page claimed that qualifiers in C ++ are constand volatile.

This response reports unsigned, unsignedand shortetc. are also qualifiers. Although the issue was mentioned C, page Wiki does not speak about it for a side C. For C qualifiers: const, volatile, restrictand _Atomic.

And the expanding message field of the qualifier"Stack Overflow" tag says

The qualifier adds an additional “quality”, such as determining the volatility or constness of a variable

“Add extra quality,” from the quote, singed / unsigned seems to meet the condition, added a limited extra quality to the integer so that it can only contain a positive number or a negative.

I am a little confused about this issue. For C and C ++ , signed, unsignedand shortetc., it is considered part of the base type or classifier type ? And please clarify if the rules are different in C and C ++.

+4
source share
2 answers

The C and C ++ signed, unsigned, shortand long- specifier type. They can be combined with int, even implicitly. signedand unsignedcan also be combined with char.

, . ( int& const, int const&)

+3

C11 (§6.7.3), const, restrict, volatile _Atomic. signed unsigned (§6.7.2).

+2

Source: https://habr.com/ru/post/1692456/


All Articles