回调函数

回调函数的简单实例

void basketball()    //函数1
{
    printf("选择篮球");
}

void football()    //函数2
{
    printf("选择足球");
}

void selectball(void (*ball)(void))    //函数3
{
    printf("选择什么球?");
    ball();
}

int main(void)
{
    selectball(basketball);
    selectball(football);
    getchar();
    return 0;
}

 参考:

 https://blog.csdn.net/hellozex/article/details/81742348
原文地址:https://www.cnblogs.com/wzqstudy/p/10443657.html