2012年9月20日

【C/C++】关于C++的名字查找与继承

摘要: 为了将问题简化,首先来看一段代码:#include <tchar.h>#include "stdio.h"class A{public: void func() { printf("A::func\n"); }};class B : public A{public: void func(int n) // 注意这里func与A的func同名,但参数不同 { printf("B::func\n"); }};int _tmain(int argc, _TCHAR* argv[]){ B b; b.func(); ... 阅读全文

posted @ 2012-09-20 11:56 jeJee 阅读(366) 评论(0) 推荐(0) 编辑

导航