 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can implement multi-path inheritance in C++. Before starting, you can note my information. You can follow my YouTube channel that is Sanjay Gupta underscore tax school. You can download my Android app that is Techimace, which is based on programming languages available on Google Play. Now coming on to the topic, for implementation of multi-path inheritance in C++, I have implemented a code for you. Here I have included a header file that is IOS cream. Then a namespace as today is used. First class is student. So student class will be inherited into a further two classes that are internal exam and an external exam. Then internal and external exam will be further inherited into result class. So here I have to use a spatial keyword that is virtual. So whenever you want to implement multi-path inheritance, you have to implement virtual keyword. So first time explaining student class, which is having two attributes roll number and branch, then read function which will read roll number and branch from user and print function which will display roll number and branch again on console. Now second class is internal exam, which is an editing student class. Here I have used a virtual keyword. Why this virtual keyword? Because student class will be inherited into two classes, internal exam and external exam. As you can see below, external exam classes implemented, which is an editing student class. Here also I have used virtual keyword. So all these two classes, internal and external exam are inheriting student class. Further, these two classes, internal exam and external exam will be inherited into result class. So both internal and external exam class having student class attributes. So if we don't use virtual keyword, then student class copies will be created twice in result class. As you can see below, internal exam and external exam are inherited into result class. So these two classes are inheriting student class. If we inherit both the classes in result class, then student class's feature will be available here twice. So if you want to make a single copy of student class, then you have to use virtual keyword while inheriting student class in internal and external exam classes. Then in internal exam class attribute, marks one is declared, which is protected. I want to access this marks one variable into derived class of internal exam class. That's why this is protected. Then read function, which is receiving marks one from user. Then print function, which will display marks one on console. Similarly, internal similar to internal exam external exam class is defined. It is having an attribute marks two protected read function and then print function. Now result class is implemented, which is inheriting internal exam and external exam classes. Its read function is calling all the read functions of student internal exam and external exam classes. Then in print function, student print function is called internal exam print function is called an external exam class print function is called at last marks one plus marks two will be displayed as total marks. So here in result class, I have called read function of all the classes. If I have not used virtual keyword, then compiler will show error message on this function call because here student class attribute will be available twice, one from internal exam and one from external exam class. So to remove this problem in case of multipath inheritance, you have to use virtual keyword as I have used above this class. Now I have created an object of result class, which is calling read and print function of result class and all read read and print functions of student internal exam and external exam classes are linked with read and print functions of result class. Now I am executing this code. You can see it is asking for roll number. I am entering 11. It is asking for branch. I am entering CS. It is asking for internal marks. I am entering 100. It is asking for external marks. I am entering 100. You can see the output roll number, branch, internal marks, external marks and total marks. All the information are displayed here. So this way you can implement multipath inheritance in C++ with the help of virtual keyword. I hope you have understood the concept well. If you want to watch more programming related videos, you can follow my YouTube channel that is Sanjay Gupta underscore Tech School. You can also download my Android app TechMS available on Google Play. Thank you for watching this video.