原来一直搞不清楚 C 中static ,extern 在各个地方的含义 今天发现在expert c programming 中的总结算是搞明白了
Symbol | Meaning |
static | Inside a function, retains its value between calls. At the function level, visible only this file. |
extern | Applied to a function definition, has global scope ( and is redundant). Applied to a variable, defined elsewhere. |
Void | As the return type of function, doesn’t return a value. In a pointer declaration, the type of a generic pointer. In a parameter list, takes no parameters. |
* | The multiplication operator. Applied to a pointer, indirection. In a declaration, a pointer. |
& | Bitwise AND operator. |
= == | Assignment operator. Comparison operator. |
<= <<= | Less-than-or-equal-to operator. Compound shift-left assignment operator. |
<
| Less-than operator. Left delimiter in #include directive. |
() | Enclose formal parameters in a function definition. Make a function call. Convert (cast) a value to a different type. Define a macro with arguments. Enclose the operand of the sizeof operator when it is a typename |