class A
{
public: virtual test()=0;
S()
{
.....
test();
.......
}
}class B: public A
{
public test()
{
........
}
pmain();
}如果函数
B::pmain()
{
A::S(); }如果这样的话 B::pmain() 函数会调用test() ,这里的test()函数因为在A中没有实现,但是在B中实现了,那这里pmain()函数中调用test()函数是调用A::test() 还是B::test()呢?谢谢
{
public: virtual test()=0;
S()
{
.....
test();
.......
}
}class B: public A
{
public test()
{
........
}
pmain();
}如果函数
B::pmain()
{
A::S(); }如果这样的话 B::pmain() 函数会调用test() ,这里的test()函数因为在A中没有实现,但是在B中实现了,那这里pmain()函数中调用test()函数是调用A::test() 还是B::test()呢?谢谢
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货