1
我一直在努力的S-功能在c.But MATLAB下面的代码是在C crashing.My基础很差:)分配指针的值,以静态变量
//
static double a=0;
//
static void mdlOutputs(SimStruct *S, int_T tid)
{
const real_T *u = ssGetInputPortRealSignal(S,0);
a=*u; //this line creates the problem
}
//
您确定'ssGetInputPortRealSignal'不返回NULL吗? –
因为您取消引用无效的u指针而导致崩溃,无论是否为NULL。 – angainor
我会检查它..谢谢大家 – feminkk