指针4

作者: 时间:2020-07-09 点击数:

函数指针:
   函数名:
函数名含义:表示函数的起始地址。(入口地址)
函数指针:能够存放函数起始地址的指针。  (函数指针变量)
函数指针定义:
    类型名 (*指针变量名)(形参);
  例如:
      int count(int tt[],int n,int *p)
   {
      .....
   .....
   *p=max;
   return bh;
   }


   int (*t)(int [],int,int *);
  函数指针赋值:
      函数指针变量名=函数名;
   t=count;
  函数调用:
      (*函数指针变量名)(实参);
      count(score,20,&bh);
   (*t)(score,20,&bh);

 

[1] [2] [3] 下一页

Copyright© 2020 Anyang Institute of Technology.All rights reserved.

学院地址:河南省安阳市黄河大道西段