#include <stdio.h>
int sum(int a, int b) {
int c = a + b;
printf("%d + %d = %d\n", a, b, c);
return a+b;
}
//原名未用别名指针
int (*MySum)(int, int);
//用typedef别名MySum
typedef int(*MySum)(int ,int);
int main() {
/*//原来只能用Sum
Sum= sum;
(*Sum)(4, 5); //只能用Sum充当指针变量
*/
//现在可以
MySum sss=sum; //相当于MySum 有个对象吧
(*sss)(4,5);
return 0;
} |