void(*function)(float); void One(float one){ cout << one << endl; } void Two(float two){ cout << two << endl; } void Three(float three){ cout << three << endl; } int main(){ function = One; function(1); function = Two;//函数指针指向可变 function(2); function = Three; function(3); return 0; }