一个函数指针数据的用法
#include<stdio.h>void func0() { puts("this is the function func0().");} //两个函数
void func1() { puts("this is the function func1().");}
/***/
void (*funcTable)(void)={func0,func1}; //两个指针的数组,指针指向返回值为void的数组
for( int i=0;i<2;++i) //使用循环计数器作为数组的索引
funcTable();
页:
[1]