Skip to content

Instantly share code, notes, and snippets.

@kaworu
Last active July 18, 2017 09:13
Show Gist options
  • Save kaworu/7ca40b4e02ae041308baec035d89a4f4 to your computer and use it in GitHub Desktop.
Save kaworu/7ca40b4e02ae041308baec035d89a4f4 to your computer and use it in GitHub Desktop.
#include <stdio.h>
struct foo {
int member;
};
int
main(int argc, char **argv)
{
struct foo f = {
.member = 42
};
(void)printf("f.member=%d\n", f.member);
f = { // XXX: doesn't work
.member = 1
};
(void)printf("f.member=%d\n", f.member);
return (0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment