指针函数:是函数,但是返回值是一个指针。
函数指针:是指针,但是指向一个函数的入口地址。
函数指针数组:是数组,数组里的元素为指针,而指针指向函数入口地址。
【1】
#include
int test(int a,int b,int(*pFunc)(int m,int n));
int Plus(int a,int b);
int Minus(int,int);
int main()
{
}
int Plus(int a,int b)
{
}
int Minus(int a,int b)
{
}
int test(int a,int b,int(*pFunc)(int m,int n))
{
}
【2】
#include
int Plus(int a,int b);
int Minus(int a,int b);
int main()
{
}
int Plus(int a,int b)
{return (a+b);}
int Minus(int a,int b)
{return (a-b);}
【3】指针函数多用于处理字符串问题(输入字符串将其中的空格删去再输出如“abc def hi”->"abcdefhi")
#include
#include
char *delete(char *p)
{
}
int main()
{
}