I understand that the size of a struct is not always the sum of it's innards, because there can be padding inbetween fields. What I am wondering is this:
Can I safely assume that two differently named structs types are the same (have the same size and same field offset) if they have the same arrangement of fields?
That is, can I assume that these two are the same:
struct a{
int a;
char b;
long c;
short d;
double e;
};
struct a{
int a;
char b;
long c;
short d;
double e;
};
even when they are defined in completely different places (different files, or different scope, or maybe anonymously defined)?