Page 24 - C-Language
P. 24
Examples 406
Running Valgrind 406
Adding flags 406
Bytes lost -- Forgetting to free 406
Most common errors encountered while using Valgrind 407
Chapter 62: Variable arguments 409
Introduction 409
Syntax 409
Parameters 409
Remarks 409
Examples 410
Using an explicit count argument to determine the length of the va_list 410
Using terminator values to determine the end of va_list 411
Implementing functions with a `printf()`-like interface 412
Using a format string 414
Chapter 63: X-macros 417
Introduction 417
Remarks 417
Examples 417
Trivial use of X-macros for printfs 417
Enum Value and Identifier 418
Extension: Give the X macro as an argument 418
Code generation 419
Here we use X-macros to declare an enum containing 4 commands and a map of their names as 419
Similarly, we can generate a jump table to call functions by the enum value. 419
Credits 421

