What is inharitance in C++? And what are the types of inheritance?

Recommended Answers

All 3 Replies

Inheritance in C++ is pretty much the same as inheritance in OOP. I could hardly explain any more than the wiki page does. If you have a more specific problem, just ask.

The types of inheritance in C++... well, that depends a bit. There are different categories depending on the point of view. Computer science academic people have all sorts of fancy terms, since they spend most of their time putting labels on things, while programmers just do what seems right without caring much about how it's called. From a more technical point of view, in C++, you can do public inheritance, private inheritance, multiple inheritance, virtual inheritance, and a few more special tricks (a bit too advanced for now). Of course, only "public inheritance" is what is generally meant by the narrow concept of "inheritance in OOP".

Inhertance is very good concept in c and c++. This is used to inherit a class within another class by this we can inherit all feature and function in second class. It save time and duplication of data. I like this concept very much.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.