GeeksforGeeks » C/C++ Programming Questions
Does this program cover overriding in C++?
(4 posts)-
#include<iostream> using namespace std; class base { public: int i; void show() { cout<<" i = "<<i; } }; class derived: public base { public: int i; /* variable overriding */ void show() /* function overriding */ { cout<<" i = "<<i; } };Is there any other way to override things in C++ ?
-
It is not overriding, just conceals the base class method.
-
Could u provide the example of overriding in C=+
-
A detailed explanation can be found on the following link,
http://msdn.microsoft.com/en-us/library/0y01k918(VS.80).aspx
Reply
You must log in to post.