In embedded firmware, driver objects often store critical configuration values.
If such objects are passed incorrectly to helper functions, part of the configuration may be lost without any compiler error.
You are given a small driver hierarchy where a helper function currently loses device-specific configuration data.
Your task is to fix the program so that all configuration values are preserved and printed correctly, without changing the driver class design.
Problem Description
The program contains:
At present, when a derived driver object is passed to the helper function, only the base configuration is printed, and the derived configuration is lost.
This behavior is incorrect for embedded systems.
Objective
Modify the program so that:
Rules (Strict)
You must follow all rules below:
Input
Two integers separated by space:
baseValue derivedValue
Program Flow (Mandatory Order)
DerivedDriver objectOutput
Print exactly two lines:
Base config <value>
Derived config <value>
Example
Input:
10 5Output:
Base config 10
Derived config 5
Constraints
Input
10 5
Expected Output
Base config 10 Derived config 5