函数指针

//
// Created by XinShuoWang on 2020/1/30.
//
#include <iostream>

void add(int a, int b) {
std::cout << a + b << std::endl;
}

void del(int a, int b) {
std::cout << a - b << std::endl;
}

void print(void (*name)(int, int)) {
auto a = 1, b = 1;
name(a, b);
}

int main() {
print(add);
print(del);
}