Hi guys, =)
I am doing a little experiment, and I found that this is really
interesting, but I don't know, can anyone please tell me why is that?
I've defined a structure like this
typedef struct myA
if I send this structure from a Linux platform to a Win32 platform, it
requires 8 bytes ( yea , some how it packes 4 bytes a unit, if c1 is 3
bytes, then it sends 4 bytes for total. It does make sense for me. )
However, If I do something like this.
typedef struct myB
char d1, d2; //(they both assign the value to "abcd")
int d3 = 0;
typedef struct myBB
char d4; //(assign the value to "abcd")
char d5; //(assign the value to "abcd")
int d6 = 0;
somehow, in myb the data in d2 will shift to d3 ( no more contains
zero value ), but in mybb, they all contain its only value.
pretty wried. =)
thanks for telling me the answer guys =)
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
||7/27/2004 10:58:57 AM