Re: [問題] 關於宣告指標函式陣列
: int ArrayNum[2]={1,2}
ArrayNum is
->
[2]: an array of
<-
int: int
: void f1(int)
f1 is
->
(int): a function take int as argument and return
<-
int: int
: void (*)(int) ArrayFuncPtr[2] ={ f1 , f2 };
ArrayFuncPtr
->
[2]: is an array of
<-
(int): ??? (function 一定要在右邊,也不是 int)
<-
(*): pointer...??? nonsense
<-
void: ???????
: void (*ArrayFuncPtr[2])(int) ={ f1 , f2 };
ArrayFuncPtr is
->
[2]: an array of
<- (括號裏面先做)
*: pointer to
->
(int): a function take int as argument and return
<-
void: void
不過還是善用 typedef 讓生命更美好。
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.34.244.41
※ 文章網址: http://www.ptt.cc/bbs/C_and_CPP/M.1411721710.A.49C.html
推
09/26 17:20, , 1F
09/26 17:20, 1F
推
09/26 23:03, , 2F
09/26 23:03, 2F
討論串 (同標題文章)
完整討論串 (本文為第 2 之 2 篇):
問題
1
2