Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [jwt@mal ~]$ cat derp.c
- #include <stdio.h>
- struct derp {
- int a;
- int b;
- int c;
- };
- int main() {
- struct derp herp =
- {.a = 1+2, 2+3, .b = 3+4, 4+5, .c = 5+6, 6+7};
- printf("a: %d, b: %d, c: %d\n", herp.a, herp.b, herp.c);
- return 0;
- }
- [jwt@mal ~]$ gcc -o derp derp.c
- derp.c: In function ‘main’:
- derp.c:11:44: warning: excess elements in struct initializer
- {.a = 1+2, 2+3, .b = 3+4, 4+5, .c = 5+6, 6+7};
- ^
- derp.c:11:44: note: (near initialization for ‘herp’)
- [jwt@mal ~]$ ./derp
- a: 3, b: 7, c: 11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement