Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Father //Base class
- {
- public:
- protected:
- int protectedv;
- };
- class Child : Father //Derived class //Inheriting from other classes lets you use
- { //the other class protected members!
- public:
- void doSomething();
- };
- int main()
- {
- Child FuckedUpKid;
- FuckedUpKid.doSomething();
- }
- void Child::doSomething()
- {
- protectedv = 13;
- cout << protectedv << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement