#include <iostream>
using namespace std;
void planA(char ch) //回调函数1
{
cout << "planA" << endl;
}
void planB(char ch)//回调函数2
{
cout << "planB" << endl;
}
{
cout << "is taking action : " << otherpara << endl;
p(otherpara);
void strategy(Situation situation) //策略的定义,不同的situation下,采取不同的策略
{
if (situation == 'A')
using namespace std;
void planA(char ch) //回调函数1
{
cout << "planA" << endl;
}
void planB(char ch)//回调函数2
{
cout << "planB" << endl;
}
typedef void (*plan) (char);//回调函数的函数指针
{
cout << "is taking action : " << otherpara << endl;
p(otherpara);
}
void strategy(Situation situation) //策略的定义,不同的situation下,采取不同的策略
{
if (situation == 'A')