void Input(ST *);
void Output(ST *);
void Bubble(ST *);
void Find(ST *);
void Failure(ST *);
/*函数声明:这五个函数都是以一个指向ST型(事先定义过)结构的指针变量作为参数,无返回值。*/
void (*process[5])(ST *)={Input,Output,Bubble,Find,Failure};
/*process被调用时提供5种功能不同的函数供选择(指向函数的指针数组)*/
printf("/nChoose:/n?");
scanf("%d",&choice);
if(choice>=0&&choice<=4)
(*process[choice])(a); /*调用相应的函数实现不同功能*;/
void Output(ST *);
void Bubble(ST *);
void Find(ST *);
void Failure(ST *);
/*函数声明:这五个函数都是以一个指向ST型(事先定义过)结构的指针变量作为参数,无返回值。*/
void (*process[5])(ST *)={Input,Output,Bubble,Find,Failure};
/*process被调用时提供5种功能不同的函数供选择(指向函数的指针数组)*/
printf("/nChoose:/n?");
scanf("%d",&choice);
if(choice>=0&&choice<=4)
(*process[choice])(a); /*调用相应的函数实现不同功能*;/
博客展示了一段代码,声明了五个以指向ST型结构指针为参数、无返回值的函数,定义了指向函数的指针数组process,提供5种不同功能。通过用户输入选择,调用相应函数实现不同功能。
908

被折叠的 条评论
为什么被折叠?



