4 * Initilization of structure containing a union:
5 * "tstlgm.c" actually is illegal anyway, since the structure
6 * only has four entries. This file is more legal. One set of
7 * compiler fixes allow this to compile (even correctly).
21 struct TEST test[] = {
26 {1,2,3,4}, /* was "{1,2,(char *)3,4}," but '82 Ritchie complains */
38 printf("Size of TEST structure = %d\n",sizeof(struct TEST));
39 printf("Size of structure test = %d\n",sizeof(test));
41 for (i = 0; i < 10; ++i){
42 printf("Cycle %d ",i);
43 printf("First = %d\tSecond = %d\t",
44 test[i].first, test[i].second);
45 printf("Union third = %d\t", test[i].third.u_int);
46 printf("Fourth = %d\n", test[i].fourth);