Your task is to demonstrate constructor execution order in Embedded C++ using inheritance.
You must write a C++ program that:
Defines a base driver class with a constructor that prints:
Base driver initialized
Prints:
Derived driver initialized
Provides a function to print:
Driver value <value>
main()
The program output must prove that the base class constructor executes before the derived class constructor.
Input:
N
Program Flow (Mandatory Execution Order):
Example Input:
5
Example Output:
Base driver initialized Derived driver initialized Driver value 5
Constraints:
new
malloc
Test Cases
Test Results
Input
Expected Output