Hi to all!
I'm trying to use a union into a struct.
I do:
and i get those warning and errors!Code:#include <stdio.h> typedef struct hello{ int x; }hello; typedef struct hey { union p{ int l = 8; hello *ptr; }types; int l; }hey; int main() { }
union.c:12: warning: no semicolon at end of struct or union
union.c:12: error: parse error before '=' token
union.c:12: warning: no semicolon at end of struct or union
union.c:15: error: parse error before '}' token
union.c:15: warning: data definition has no type or storage class
union.c:19: error: parse error before '}' token
union.c:19: warning: data definition has no type or storage class
What do i do wrong?
Thanks in advance!![]()



LinkBack URL
About LinkBacks





