我正在嘗試使一個具有函數指針的結構具有相同結構作爲參數的函數。我現在有這個。具有相同參數類型的結構中的函數指針
像error: expected ‘)’ before ‘*’ token
typedef struct sharedData
{
sem_t* forks;
int id;
void (*forkFunc)(sharedData*);
};
我收到錯誤,像
warning: no semicolon at end of struct or union
warning: useless storage class specifier in empty declaration
警告我究竟做錯了什麼?
你是不是要編寫struct sharedData *呢? – 2011-02-04 05:39:57