Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Family.h" // Declares two classes, Parent and Child (which inherits from Parent), and their member functions
- #include <iostream>
- Parent::Parent(){
- }
- Parent::OuterFunc(){
- InnerFunc();
- }
- Parent::InnerFunc(){
- cout << "Hello, this is Parent.";
- }
- Child::Child()
- : Parent()
- {
- }
- Child::InnerFunc(){
- cout << "Hello, this is Child.";
- }
- int main(){
- auto c = Child();
- c.OuterFunc();
- // What is the output?
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement