Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include "Family.h" // Declares two classes, Parent and Child (which inherits from Parent), and their member functions
  2. #include <iostream>
  3.  
  4. Parent::Parent(){  
  5. }
  6.  
  7. Parent::OuterFunc(){
  8.     InnerFunc();
  9. }
  10.  
  11. Parent::InnerFunc(){
  12.     cout << "Hello, this is Parent.";
  13. }
  14.  
  15. Child::Child()
  16.     : Parent()
  17. {
  18. }
  19.  
  20. Child::InnerFunc(){
  21.     cout << "Hello, this is Child.";
  22. }
  23.  
  24. int main(){
  25.     auto c = Child();
  26.     c.OuterFunc();
  27.     // What is the output?
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement