C/C++语言中的概念¶
1 specifier (说明符)¶
1.1 format specifier(格式说明符)¶
| SPECIFIER | USED FOR |
|---|---|
| %c | a single character |
| %s | a string |
| %hi | short (signed) |
| %hu | short (unsigned) |
| %Lf | long double |
| %n | prints nothing |
| %d | a decimal integer (assumes base 10) |
| %i | a decimal integer (detects the base automatically) |
| %o | an octal (base 8) integer |
| %x | a hexadecimal (base 16) integer |
| %p | an address (or pointer) |
| %f | a floating point number for floats |
| %u | int unsigned decimal |
| %e | a floating point number in scientific notation |
| %E | a floating point number in scientific notation |
| %% | the % symbol |
1.2 access specifier (访问说明符)¶
public, private, protected
1.3 declaration specifier(声明说明符)¶
friend,typedef, constexpr。
1.3.1 storage class specifier(存储类别说明符)¶
register, static, thread_local, extern, mutable.
1.3.2 function specifier(函数说明符)¶
inline, virtual, explicit。
1.3.3 type specifier(类型说明符)¶
int, float。
1.3.4 alignment specifier(对齐说明符)¶
alignas
1.3.5 nested name specifier(嵌套命名说明符)¶
::