老玉米:
看样子确实是这样.不过还是很confused...
[阅读: 345] 2007-03-30 08:15:09
[root@tivc32 tmp]# cat test.cpp
struct A {
virtual void f(){}
};
struct B: public A {
void f(int){}
};
int main(){
B *b = new B;
b->f();
return 0;
}
[root@tivc32 tmp]# g++ test.cpp
test.cpp: In function `int main()':
test.cpp:10: no matching function for call to `B::f()'
test.cpp:5: candidates are: void B::f(int)
把B::f(int)注释掉就可以..