I needed to create a function-like macro which set a parameter in a default settings struct, simple enough. struct Settings { unsigned enabled; }; struct Settings defaultSettings; #define SetEnabled(enabled) (defaultSettings.enabled = enabled) ...
The #define directive in C is used for creating macros, constants, and inline functions. Let's go through examples of each: Constants using #define: Defining a constant using #define. #include <stdio.h> // Define a constant #define ...