Advertisement
tomasaccini

Untitled

Jul 15th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. class Base {
  4. public:
  5.     void imprimir() {std::cout << "Base!" << '\n';};
  6. };
  7.  
  8. class Derivada1 : protected Base {};
  9.  
  10. class Derivada2 : public Derivada1 {
  11. public:
  12.     void imprimir_aux() {
  13.         imprimir();
  14.     };
  15. };
  16.  
  17. int main() {
  18.     Derivada2 d;
  19.     d.imprimir_aux();
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement