1974 shaares
6 private links
6 private links
7 results
tagged
macro
Extending C with cmacro
C99 introduced the concept of designated initializers, that allows to initialize a structure using the name of the fields, like this:
struct {int x, float y} MyStruct;
MyStruct a = {
.x = 10,
.y = 3.6,
};
Here is a C macro that extends this syntax to function calls.