Hello friends, in this post today, we learn about Inheritance in c++ concept and types of inheritance in c++ . Which is very important. so lets start... Inheritance Inheritance Class can acquire the properties and methods of another class. Inheritance is the process of deriving a new class from an already existing class. In other words" Inherit all the properties and methods of class into another class, is called Inheritance." Inheritance provides the idea of reusability i.e., code once written can be used again and again in number of new classes. The new class is called derived class and old class is called base class. The new class can use all or some of the features of the already existing class and the programmer can define his own members to the new class. Types of Inheritance In c++, there are 5 types of inheritance. Types of Inheritance Syntax of Inheritance:- class derived_classname : access_spacifier base_classname Where class is keyword used to create a clas
Hello friends, i n this post today, we learn about What is exception handling in c++ and how to handle exception in c++ . so lets start... Exception handling Exception handling:- Exception is any abnormal behaviour. In C++ errors can be two types. 1. Compile time errors and 2. Run time errors. Compile time errors are syntax errors which occurs during the writing of the program. Most common examples of compile time errors are missing semicolon, missing comma, missing double quotes, etc. The syntax error is detected during compilation of program, but the Run time error will detect during execution of program. So, it is very difficult to handle logical error. C++ provides exception handling mechanism which can be used to trap this exception and running programs smoothly after catching the exception. The exception handling provides mechanism to handle logical error during execution of program with appropriate response. Steps to handle Run time error: 1. Find the problem (Hit