signed
suggest changeA keyword that is part of certain integer type names.
- When used alone,
intis implied, so thatsigned,signed int, andintare the same type. - When combined with
char, yields the typesigned char, which is a different type fromchar, even ifcharis also signed.signed charhas a range that includes at least -127 to +127, inclusive. - When combined with
short,long, orlong long, it is redundant, since those types are already signed. signedcannot be combined withbool,wchar_t,char16_t, orchar32_t.
Example:
signed char celsius_temperature;
std::cin >> celsius_temperature;
if (celsius_temperature < -35) {
std::cout << "cold day, eh?\n";
}
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents