1. gcc: gcc -o build xxx.c. -->
2. Macro #define ABC (5+3)
#defien ABC(x) (5+(x))
#define MIN(A,B) ((A) <= (B) ? (A) : (B))
3. Singed: MSB is sign bit. 1 is negative
4. "goto" can only jump in the function. Cannot jump bettwen functions
5. Storage class(specify the location of variables):
- auto(default) R/W, if the auto variable is in the {}, then its stored in SLACK
- register, stored in register. cannot use & to get the address
- static, Static variables are allocated memory in data segment, not stack segment and can also won't be used by other file if there functions have the same name.
- const, cannot edit directly, but can be changed by using pointer
- extern,
- volatile, won't be optimize by the compiler.
6. Operator :
- Logic Operator A && B, won't caculate B if A is 0. so A && B != B && A
- When >>, nagative value fill the MSB with "1" instead of zero.
- reset bit 5: result = a & (~(0x1 << 5)); to make sure MSB-->BIT 5 is 0.
7. Pointer:
const char *p/char const *p: the content cannot be changed
char * const p/char *p const: address cannot be changed
8. Storage of embedded C