这个 Note 用来记录各处收集的 C 编程 tricks. 看到有意思的就会摘一下，来源各异。
C99 offers some really cool stuff using anonymous arrays:
Removing pointless variables
Passing a Variable Amount of Arguments
Static linked lists
Include data file as header inside array initializer
__LINE__ for debugging
Dynamically sized object(modified)
An example of
This works by casting a null pointer into a pointer to structure st, and then obtaining the address of member m within said structure. While this implementation works correctly in many compilers, it has undefined behavior according to the C standard, since it involves a dereference of a null pointer (although, one might argue that no dereferencing takes place, because the whole expression is calculated at compile time). It also tends to produce confusing compiler diagnostics if one of the arguments is misspelled.
Blank in a
scanf() format, a blank, tab or newline means ‘skip white space if there is any to skip’. It does not directly ‘clear the input buffer’, but it does eat any white space which looks similar to clearing the input buffer (but is quite distinct from that). If you’re on Windows, using
fflush(stdin) clears the input buffer (of white space and non-white space characters); on Unix and according to the C standard,
fflush(stdin) is undefined behaviour.