如上所述,我收到一个错误:mHbbtSMFnPtrs[mCurrHbbtvState][hbbtvSMEvntsParam](hbbtvSMEvents, hbbtvSMEvntsParam) 中的 operator[] 不匹配;
typedef int (*HBBTVSMFnPtr)(int hbbtvSMEvent, HBBTVSMEvntParam smEvntParam );
static int HBBTVSMErrorHandler(int hbbtvSMEvent, HBBTVSMEvntParam smEvntParam);
宣言:
static HBBTVSMFnPtr mHbbtSMFnPtrs[HBBTV_SM_STATE_MAXSTATES][HBBTV_SM_EVNT_MAXEVNTS];
static int mCurrHbbtvState = HBBTV_SM_STATE_TURNEDOFF;
typedef struct
{
char* param;
int paramLength;
}HBBTVSMEvntParam;
是任务:
mHbbtSMFnPtrs[loopVar1][loopVar2] = HBBTVSMErrorHandler;
并这样称呼它:
int a = mHbbtSMFnPtrs[mCurrHbbtvState][hbbtvSMEvntsParam](hbbtvSMEvents, hbbtvSMEvntsParam);