????C++?к??????????
???????????? ???????[ 2014/1/14 10:03:32 ] ????????C++ ????
??????????????????????á?
????//???1??????????(*??????)(??????)
char (*pFun)(int);
char glFun(int a){ return;}
void main()
{
pFun = glFun;
(*pFun)(2);
}
????????ж??????????????pFun????????????????????“???1”??????????????????????????????????????????int??????????char???????е?????????????????????????????δ???????и????
????????ж????????????glFun()???ú??????????????int?????????char???????????????????????????——?????????????????????????????????ú??????????????е???????
?????????????main()??????????????????????????——????????glFun?????????????pFun??main()????????????“*pFun”??????pFun????????????????????????????glFun()??????????????????2??
?????????????typedef??????????
????//???2??typedef ????????(*??????)(??????)
typedef char (*PTRFUN)(int);
PTRFUN pFun;
char glFun(int a){ return;}
void main()
{
pFun = glFun;
(*pFun)(2);
}
????typedef???????????μ?????????????????????PTRFUN????????????????????????????????????????????????int???????????char?????????????????int??char??????PTRFUN???
????????е?????????????????????????pFun?????????????????1????????????????
????????????C++??????ú??????
????//???3??typedef ????????(????::*??????)(??????)
class CA
{
public:
char lcFun(int a){ return; }
};
CA ca;
typedef char (CA::*PTRFUN)(int);
PTRFUN pFun;
void main()
{
pFun = CA::lcFun;
ca.(*pFun)(2);
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11