Skip to content

Instantly share code, notes, and snippets.

@kaworu
Created July 18, 2017 09:16
Show Gist options
  • Save kaworu/d0b86b4e11fefd18b3f73ca23a38ea1a to your computer and use it in GitHub Desktop.
Save kaworu/d0b86b4e11fefd18b3f73ca23a38ea1a 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 = (struct foo) {
.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