This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

结构体指针赋值,高低位反了



你好,

代码修改过程中,发现程序跑飞,有非法指针的情况。

仔细一看,发现一个指针赋值操作后,高低16位正好倒了一下,请问这是为什么?

之前程序能正常跑的,修改的代码部分也与这段程序无关。

void initialize(RT_MODEL_rtw_servo_fbk *const rtw_servo_fbk_M)
{

D_Work_rtw_servo_fbk *rtw_servo_fbk_DWork = ((D_Work_rtw_servo_fbk *)
rtw_servo_fbk_M->ModelData.dwork);

}

其中,D_Work_rtw_servo_fbk是一个结构体。

Compiler version: TI v8.2.2