您当前的位置: 首页 >  c++

txwtech

暂无认证

  • 3浏览

    0关注

    813博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

ca71a_c++_指向函数的指针_通过指针调用函数txwtech

txwtech 发布时间:2020-02-10 12:25:18 ,浏览量:3

/*ca71a_c++_指向函数的指针_通过指针调用函数 用typedef简化函数指针的定义 简化前:     bool(*pf)(const string&, const string &);     bool(*pf2)(const string&, const string &);     bool(*pf3)(const string&, const string &);

简化后:     typedef bool(*cmpFcn)(const string &, const string &);     //具体应用参考main函数内部代码     comFcn pf;     comFcn pf2;     comFcn pf3; 指向函数的指针的初始化和赋值 通过指针调用函数 函数指针形参 返回指向函数的指针

//ff是一个函数,有一个形参x,返回的结果是一个函数指针int(*)(int *,int), int(*ff(int x))(int *, int)

{     cout

关注
打赏
1665060526
查看更多评论
立即登录/注册

微信扫码登录

0.0398s