Endianness Work-around Needed

后端 未结 2 1882
再見小時候
再見小時候 2021-01-17 01:03

Consider the following piece of code:

#include \"stdio.h\"

typedef struct CustomStruct
{
  short Element1[10];
}CustomStruct;

void F2(char* Y)
{
  *Y=0x00;         


        
2条回答
  •  野的像风
    2021-01-17 01:29

    If F2() is receiving a char *, then it must be doing something pretty strange in order to cause endian-related problems.

    These only happen when accessing more than one char at a time, unless it's manually doing such accesses while being broken. Is it casting it's argument back to short * or something?

    In short, show more code.

提交回复
热议问题