函数指针运用示例
int F1(int a, int b) { return a + b; } int F2(int a, int b) { return a - b; } int F3(int a, int b) { return a * b; } int F4(int a, int b) { return a / b; } void x6t7() { using F = int(*)(int, int); vector<F> ver; ver.push_back(F1); ver.push_back(F2); ver.push_back(F3); ver.push_back(F4); int a = 4, b = 2; for (auto Fun : ver) cout << Fun(a, b) << "\t"; cout << endl; }