nested structures in C
Posted on 2005-05-03
I having a nested structures which are referenced with pointer variables
struct test *test1;
struct sample *mysample;
printf("Inside main method \n\n");
mysample->test1->i=1; // It's throws segmentation fault error at this point how to access this variable.
printf("the value of the k is %d \n\n",mysample->k);
// printf("the value of the k is %d \n\n",mysample->test->i);
While trying to access the value of i as mysample->test1->i it throws segmentation fault error.
How to access this variable.