Quick actions

cmd+k|ctrl+k

Navigation

Languages

All Good C only features

Snippet info

Language

C

Visibility

public

Author

evine

Created

2019-01-17T20:29:21Z

Updated

2019-01-17T20:33:49Z

#include <stdio.h>

typedef struct {
    int start;
} Thing;

void f(Thing *a) {
    printf("%i\n", a->start);
}

int main(void) {
    // L-value literal
    Thing *a = &(Thing){
        // Init by name
        .start = 53
    };
    
    // L-value literal makes code more uniform and easier to refactor.
    printf("%i\n", a->start);
    f(a);
    
    return 0;
}
INFO