#include <iostream> using namespace std; namespace UART { int baudRate = 115200; } namespace SPI { int clockSpeed = 1000000; } int main() { cout << "UART Baud: " << UART::baudRate << "\n"; cout << "SPI Clock: " << SPI::clockSpeed << "\n"; return 0; }
Solution Explanation
Layman’s Terms
Think of two folders: one has UART settings, the other SPI settings. You open each by prefixing with the folder name.
Significance for Embedded Developers
This mirrors real embedded projects, where UART, SPI, I²C configs, etc., are grouped separately to avoid mix-ups.
Test Cases
Test Results
Input
Expected Output
UART Baud: 115200 SPI Clock: 1000000