G
Guest
When we have a structure in the following form
typedef struct {
int I1;
int I2;
int I3;
int I4;
float F1;
float F2;
float F3;
float F4;
} TMyStru;
and a code segment as follows;
TMyStru D;
D.I1=0; D.I2=1; D.I3=2; D.I4=3;
D.F1=4.0; D.F2=4.0; D.F3=6.0; D.F4=7.0;
unsigned char *Buf = new unsigned char [sizeof(TMyStru)];
memcpy(Buf, &D, sizorf(TMyStru));
Does "Buf" ALWAYS (regardless of a particular C/C++ compiler) contains the
content of "D" in I1,I2,I3,I4,F1,F2,F3,F4 order ?
ie I1 appears infront of I2 ...
typedef struct {
int I1;
int I2;
int I3;
int I4;
float F1;
float F2;
float F3;
float F4;
} TMyStru;
and a code segment as follows;
TMyStru D;
D.I1=0; D.I2=1; D.I3=2; D.I4=3;
D.F1=4.0; D.F2=4.0; D.F3=6.0; D.F4=7.0;
unsigned char *Buf = new unsigned char [sizeof(TMyStru)];
memcpy(Buf, &D, sizorf(TMyStru));
Does "Buf" ALWAYS (regardless of a particular C/C++ compiler) contains the
content of "D" in I1,I2,I3,I4,F1,F2,F3,F4 order ?
ie I1 appears infront of I2 ...