13 Sept 2017

What is the output for this code?

class A
{
Virtual fun1( );
Fun2( );
};
class B: public A
{
};
class C: public B
{
Virtual fun1( );
};
Q.i.) int main( )
{
A *p =new B
p -> fun1( );
}
Q.ii.) int main( )
{
A *p = new C
p -> fun1( );
p -> fun2( );
}


explain clearly how it works? on comment section

No comments:

Post a Comment

commnet here