#include "stdio.h"typedef int (*FUN)(int x,int y);FUN m_fun;int add(int x,int y){ return x+y;}int sub(int x,int y){ return x-y;}enum method{ Add=1, Sub};void ChooseFun(method md,int x,int y){ switch(md) { case Add: m_fun=add; break; case Sub: m_fun=sub; break; default: m_fun=add; } printf("X+Y=%d",m_fun(x,y));}int main(){ ChooseFun(Add,3,4); getchar();}