#include <stdio.h> int max(int x, int y){ return x > y ? x : y; } int main(){ int x = 1, y = 2; //函数指针 int(* p_max)(int x, int y); p_max = &max; //指针数组 int *p1[10]; //数组指针 int (*p2)[10]; printf("%d ", max(x, y)); printf("%d ", (*p_max)(x, y)); }
#include <stdio.h> int max(int x, int y){ return x > y ? x : y; } int main(){ int x = 1, y = 2; //函数指针 int(* p_max)(int x, int y); p_max = &max; //指针数组 int *p1[10]; //数组指针 int (*p2)[10]; printf("%d ", max(x, y)); printf("%d ", (*p_max)(x, y)); }