Re: [问题] 关于宣告指标函式阵列

楼主: carylorrk (carylorrk)   2014-09-26 16:55:07
: 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 让生命更美好。
作者: ckvir (ckvir)   2014-09-26 17:20:00
感谢解答,另外请问typedef以这个例子来说要怎改写?
作者: bluesoul (忙死你老爸)   2014-09-26 23:03:00
讲的真清楚

Links booklink

Contact Us: admin [ a t ] ucptt.com