// test_min_max.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include <iostream>
using namespace std;

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

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

int main()
{
    int a,b;
    a=10;
    b=100;

    //一般的函数调用形式
    int c=find_max(a,b);
    cout<<c<<endl;

    //通过指针函数/回调函数的形式
    int (*p)(int,int);
    p=find_min;
    int d=(*p)(a,b);
    cout<<d<<endl;

    return 0;
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2021-12-01
猜你喜欢
  • 2022-12-23
  • 2021-08-04
  • 2021-11-30
  • 2021-11-11
  • 2021-10-25
相关资源
相似解决方案