指向函数的指针

来源:互联网 发布:企业资质软件下载 编辑:程序博客网 时间:2024/04/30 08:59
#include <stdio.h>

float max(float x, float y)
{
return x > y ? x : y;
}

int main()
{
float a = 1.1, b = 2.2;

float (*p)(float x, float y);
p = max;

printf("%f\n", (*p)(a, b));

return 0;
}
原创粉丝点击