請問typedef int(_stdcall* topenPort)(char *port, int baundrate)這段代碼怎么理解?
1 回答

慕哥6287543
TA貢獻1831條經驗 獲得超10個贊
用typedef定義了一種函數指針類型topenPort,這種指針可以指向下面這種函數:
int _stdcall f(char* port,int baundrate) //返回int 有一個char*類型和一個int類型的參數,_stdcall說明該函數參數是從右往左入棧的
{......
return 666;
}
//于是可以這樣使用topenPort類型:
topenPort pf1; //定義一個指針
pf1=f; //指向f
添加回答
舉報
0/150
提交
取消