Kevin De Baerdemaeker

C not Cpp, nor C++

Modified 2025-09-24

External Variables

The external variables can only be defined once, outside of any function. The external variables must be defined with extern in each function which needs these variables. Usually the extern declarations are collected in a header file, and then the extern definitions prepare them for usage in the functions.

Preprocessor

__FILE__, __func__ and __LINE__ are useful to report errors to devs.

There's so many directives I haven't heard before: #error#, multiline #define's, ## (concatenation), ...

References