Menu

Custom Search

C++ lab Program

/*
Type and run the following program(virtual function and Dynamic binding(ii)).
*/

#include
#include
class Base{
protected: int b;
public: Base(){
cout<<"Base constructor"<display();

ptr->display();
delete ptr;
getch();
return 0;
}
/*OUTPUT
Base constructor
Derived constrctor
Base constructor
Derived constructor
d1=11
d1=11
Base destructor
*/

No comments:

Post a Comment