In the C++ program:
#include<iostream.h>
class A
{
public: virtual void func()=0;
};
class B:public A
{
public: void show()
{
func();
}
};
void B::func()
{
cout<<"In B"<<endl;
}
int main()
{
B b;
b.show();
}
If the virtual function, func() is redefined within body of the class B, there is no error. But when using the scope resolution operator, the compiler throws an error. Why is that?