P
P
Piloowar2017-06-22 21:12:27
OOP
Piloowar, 2017-06-22 21:12:27

C++ OOP work with classes!?

class b{
  public:
  void shw(){
    a::show();
    }
  };	

class a: public b{
public:
  int q,w;
  a(){q=10;w=15;}
  void show(){
    }
  };

How can I call a class method from class b?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
devalone, 2017-06-23
@Piloowar

The base class should not know who inherits from it, so your option is wrong. Maybe virtual functions are suitable for you, google how they work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question