A collection of interesting/useful tricks in C
- macro
- coroutine: coroutine in C
- generic function: use _Generic macro to provide a uniform interface for different types
- base 2 representation: use hex number to represent binary number
- generic linked list: a generic linked list implemented using macro. The idea is taken from the linked list in Linux kernel. The same approach can be taken to implement other generic data structures.
- x-macro: interesting hack with c preprocessor, though hardly useful
- indirect_stringify
- misc
- Duff's device: This version of Duff's device is easier to understand than the original one. Interesting trick, but not useful anymore.