2011年12月24日

怎么将一个类的成员函数作为指针传递给另一个类的成员函数

摘要: 今天帮同学解决了一个问题,怎么把一个类的成员函数作为指针传递给另一个类的成员函数。以前只接触过C语言中的函数指针:#include <iostream.h>void add(int a,int b){cout<<"the value of add is "<<a+b<<endl;}void mul(int a,int b){cout<<"the value of multiple is "<<a*b<<endl;}/*void (*fun)(int,int)是要传入的函数 阅读全文

posted @ 2011-12-24 20:26 沉沉-_- 阅读(5275) 评论(0) 推荐(0) 编辑

导航