D
David Li
I use VC++6.0 to code.
When I defined: struct Prop { UINT32 obj;} , and I read bytes from
file: {
char buf[4]); fread(buf,4); } then I use (Prop*)buf to set m_prop
which is declared as Prop;(m_prop = (Prop*)buf),but the value of m_prop
is reversed to buf. Why?
for example: buf is 0x50,0x51,0x52,x053, and m_prop->ojb is:
0x53,0x52,0x51,0x50.
my OS is winxp.
When I defined: struct Prop { UINT32 obj;} , and I read bytes from
file: {
char buf[4]); fread(buf,4); } then I use (Prop*)buf to set m_prop
which is declared as Prop;(m_prop = (Prop*)buf),but the value of m_prop
is reversed to buf. Why?
for example: buf is 0x50,0x51,0x52,x053, and m_prop->ojb is:
0x53,0x52,0x51,0x50.
my OS is winxp.