about multi level inheritance

This commit is contained in:
Jidong Xiao
2025-04-11 04:58:52 -04:00
committed by JamesFlare1212
parent 28a8f7d285
commit 235168710e

View File

@@ -177,6 +177,10 @@ We develop this student_test.cpp program.
[student_test4.cpp](student_test4.cpp) In this version, we added the destructor to both the child class and the parent class. This program shows that when the child class object is destroyed, first its own destructor gets called, and then its parent destructor gets called. [student_test4.cpp](student_test4.cpp) In this version, we added the destructor to both the child class and the parent class. This program shows that when the child class object is destroyed, first its own destructor gets called, and then its parent destructor gets called.
### version 5
[student_test5.cpp](student_test5.cpp) In this version, we added the CSStudent class, and that introduces multilevel inheritance in the program.
## 25.7 What will be printed when running this program? ## 25.7 What will be printed when running this program?
#include <iostream> #include <iostream>