- 論壇徽章:
- 59
|
回復(fù) 3# liuyang7078
- // 定義
- void send_xchar_imp(struct tty_struct *tty, char ch){
- return;
- }
復(fù)制代碼 int main(){
tty_struct stty;
char ch;
void send_xchar_imp(struct tty_struct *tty, char ch); // 聲明的示例,無(wú)用,只是和下列做對(duì)比。
void (*send_xchar)(struct tty_struct *tty, char ch); //宣言
void (*send_xchar2)(struct tty_struct *tty, char ch)=send_xchar_imp; //宣言同時(shí)初始化
send_xchar=send_xchar_imp;
send_xchar_imp(&stty,ch); //一般的函數(shù)調(diào)用
send_xchar(&stty,ch); // 通過(guò)函數(shù)指針調(diào)用
send_xchar2(&stty,ch); // 通過(guò)函數(shù)指針調(diào)用
return 0;
}
|
|