#include <stdio.h>

struct X { int a, b, c; };

int main(void) {
	struct X x = {.a=1, .b=2};
	printf("x: %d %d %d\n", x.a, x.b, x.c);
	x = (struct X){.a=1, .c=3};
	printf("x: %d %d %d\n", x.a, x.b, x.c);
	// initialize a const
	// order can be changed when elements are named
	const struct X cx = {.c=3, .b=2, .a=1};
	printf("cx: %d %d %d\n", cx.a, cx.b, cx.c);
	// cast the const away
	((struct X*)(&cx))->a = 0;
	printf("cx: %d %d %d\n", cx.a, cx.b, cx.c);
	return 0;
}
