Considering the expression:
Code:
strt_c->strt_b->strt_a
strt_b is not a pointer, so it doesn't make sense to use ->strt_a, it should be:
Code:
strt_c->strt_b.strt_a.
Further, strt_a is an array of pointers, so you need:
Code:
strt_c->strt_b->strt_a[0]->a1
(or whatever index you need)
The following changes fix it so it compiles. The code is still ridiculous:
Code:
strt_c->strt_b.strt_a[strt_c->strt_b.a_cnt] = (struct a *)malloc(sizeof(struct a)); /*line 26*/
strt_c->strt_b.strt_a[0]->a1=1234; /*line 28*/
printf("strt_c->strt_b->strt_a->a1: %d\n",strt_c->strt_b.strt_a[0]->a1); /*line 30*/
free(strt_c->strt_b.strt_a[strt_c->strt_b.a_cnt]); /*line 32*/
Also, don't cast the return of malloc, and make sure you #include <stdlib.h>