Hallo,
es ist vermutlich eine Anfängerfrage, aber trotzdem...
Ich habe ein Union der Form:
1 | union convert
|
2 | {
|
3 | UINT8 Bytes[4];
|
4 | UINT32 Value;
|
5 | }convertVar;
|
Weiterhin habe ich ein unsigned char tabx[4];
der Form:
1 | unsigned char tabx[4];
|
2 | tabx[0]=0x00;
|
3 | tabx[1]=0x01;
|
4 | tabx[2]=0x02;
|
5 | tabx[3]=0x00;
|
Über
1 | unsigned int X;
|
2 | convertVar.Bytes[0] = tabx[0];
|
3 | convertVar.Bytes[1] = tabx[1];
|
4 | convertVar.Bytes[2] = tabx[2];
|
5 | convertVar.Bytes[3] = tabx[3];
|
6 | X = convertVar.Value;
|
Ich würde erwarten, dass X jetzt gleich 120 ist. Dies ist aber mit
nichten der Fall.
Wo ist hier der vermutlich dumme Denkfehler?