posts - 25,  comments - 21,  trackbacks - 0

遇到一个问题随便一个class,到底有多少个成员函数在里面
class CTestClass
{
public:

 virtual int test_virtual_multiply(int x)
 {
  return x*x;
 }
 int test_add(int x, int y)
 {
  return m_Value1+x+y;
 }
 int m_Value1;
};
编译器,可能会添加default constructor,也可能会添加default copy constructor,同时会遇到,如果你没有调用相关函数,编译器会不生成相关函数的引用,也就查询不到该函数,呵呵。具体见书:"inside the c++ object model";
另外,还可能会添加destructor函数,如果需要。这些个问题,情况比较多,还是请仔细参考好书:"inside the c++ object model";

posted on 2008-04-26 11:32 Sherk 阅读(493) 评论(0)  编辑 收藏 引用
只有注册用户登录后才能发表评论。
<2008年4月>
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

常用链接

留言簿(3)

随笔档案

相册

好友

搜索

  •  

最新评论

阅读排行榜

评论排行榜