I have following code
#include <stdio.h>
#include<ctype.h>
typedef struct {
int Type;
int Type2;
}foo;
typedef struct {
char cData[40];
}bar;
int main()
{
bar b1;
strcpy(b1.cData,"11");
foo *f=(struct foo *)&b1;
printf("Type is %d \n",f->Type);
return 0;
}
But i am not getting the value of type 1 in f's pointer , instead i am getting size of that particuler struct.