#include <iostream> using namespace std; namespace Config { namespace ADC { int resolution = 12; } namespace PWM { int frequency = 1000; } } int main() { cout << "ADC.resolution=" << Config::ADC::resolution << "\n"; cout << "PWM.frequency=" << Config::PWM::frequency << "\n"; return 0; }
Solution Explanation
Config::PWM::frequency
Layman’s Terms
It’s like we already made two subfolders inside Config — one for ADC, one for PWM. You just need to open them and read what’s inside.
Significance for Embedded Developers
This is very common in firmware projects:
Config::ADC
Config::PWM
It’s a neat way to organize subsystem-specific parameters.
Test Cases
Test Results
Input
Expected Output
ADC.resolution=12 PWM.frequency=1000