#include <iostream> using namespace std; namespace Config { int baudRate = 9600; int threshold = 50; } int main() { cout << "Baud: " << Config::baudRate << ", Threshold: " << Config::threshold; return 0; }
Explanation & Logic Summary:
Config
main()
Layman’s Terms
Think of Config like a settings folder. You put baudRate and threshold inside, and the program fetches them from there.
Firmware Relevance & Real-World Context:
This mirrors how embedded firmware often groups constants and configuration values in namespaces for organization and type safety.
Test Cases
Test Results
Input
Expected Output
Baud: 9600, Threshold: 50