To avoid typing the struct name and parentheses every time, you can wrap the function call in a variadic macro.
: The caller must still know the order or use "sentinel" values (like NULL ) to mark the end of the argument list. Summary of Techniques Supports Named? Supports Optional? Standard Requirement Standard Positional Struct + Initializer Yes (defaults to 0) C99 or later Variadic Macros Yes (via struct) C99 or later stdarg.h Yes (manual)
: Used to retrieve an indefinite number of arguments.
For a more "classic" C approach, you can use variadic functions, though these do not provide true named parameters and are harder to use safely.
Struct members not explicitly initialized are automatically set to zero or NULL by the compiler, effectively making them "optional". Example Implementation:





