
在父类中有一个函数,在其派生类中有一个函数名相同的函数,那么派生类的对象无法调用父类的函数
1 |
#include <iostream> |
The output of this program is:
1 |
f(double): 6.3 |
Instead of the supposed output:
1 |
f(int): 6 |
在父类和子类中没有函数重载

在父类中有一个函数,在其派生类中有一个函数名相同的函数,那么派生类的对象无法调用父类的函数
1 |
#include <iostream> |
The output of this program is:
1 |
f(double): 6.3 |
Instead of the supposed output:
1 |
f(int): 6 |
在父类和子类中没有函数重载
近期评论