We have already created a namespace Config with two variables:
Config
namespace Config { int baudRate = 9600; int threshold = 50; }
Your task is to:
using namespace Config;
main()
Config::
The program should print:
Baud: 9600, Threshold: 50
Example Output:
Why this output?Because using namespace Config; makes the variables available in the current scope without the Config:: prefix.
Question SignificanceThis problem demonstrates how the using namespace directive imports all names from a namespace into the current scope.
using namespace
Test Cases
Test Results
Input
Expected Output