欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

c++ 函数指针

程序员文章站 2022-05-30 09:27:47
``` include include using namespace std; int max(int a,int b){ return a b ? a: b; } int main() { int ( func)(int,int); func = max; int a = 10,b=11; co ......
#include <iostream>
#include <cstring>

using namespace std;


int max(int a,int b){
    return a > b ? a: b;
}


int main() {
    int (*func)(int,int);
    func = max;
    int a = 10,b=11;
    cout << (*func)(a,b) << endl;
}