/ simple way to understand structure pointer*/
#include<stdio.h>
struct data 1
{
float *e;
float *f;
};
struct data
{
Int *a;
Int *b;
struct data 1 *d1;
};
Int main()
{
Struct data d;
d.d1 = malloc(1);
d.a = malloc(1);
d.b = malloc(1);
d.d1 = malloc(1);
d.d1 - > e = malloc(1);
d.d1 -> f = malloc(1);
*d.a = 10;
*d.b = 5;
printf(“%d %d\n”,*d.a,*d.b);
printf(“%d\n”, sizeof(d));
printf(“%d\n”,sizeof(d.d1));
printf(“%f”,*d.d1->e);
return 0;
It looks like you're new here. If you want to get involved, click one of these buttons!