Hi all,
My question is as follows:
Say you have the following classes:
class BaseClass{
public:
int basevar;
};
class ChildClass : public BaseClass{
public:
int childVar1;
int childVar2;
};
I am using a CGT 6.1.11, and what I see happening is the BaseClass is being padded with 4 bytes so that it is eight-byte aligned, and thus sizeof(ChildClass) is 16 rather than 12. My problem stems from the fact that I am transmitting various objects like this out via the MCBSP and reading them in on another embedded device. When I try to parse the incoming data stream, I get the wrong result because the other embedded device (with code compiled via gcc) does not pad structures so that, on the other embedded device, sizeof(ChildClass) would be 12. Is there some way to gracefully handle this?
Many thanks,
-B