Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ````
- static const char *season[] = {
- [0] = "Winter",
- [1] = "Spring",
- [2] = "Summer",
- [3] = "Fall",
- };
- struct WTF {
- const char *season;
- };
- static const struct WTF wtf = { .season = season[2] };
- ````
- mattst88@framework ~ % gcc -c t.c -o t.o
- t.c:12:43: error: initializer element is not constant
- 12 | static const struct WTF wtf = { .season = season[2] };
- | ^~~~~~
- t.c:12:43: note: (near initialization for ‘wtf.season’)
Add Comment
Please, Sign In to add comment