Google News
logo
CPP - Quiz(MCQ)
Which keyword is used to access the variable in the namespace?
A)
static
B)
const
C)
using
D)
dynamic

Correct Answer :   using


Explanation :

using keyword is used to specify the name of the namespace to which the variable belongs.

EX : 
namespace A{ int a = 5;}
namespace B{ int a = 10;}
using namespace A;
cout<<a; // will print value of a from namespace A.
using namespace B;
cout<<a; // will print value of a from namespace B.

Advertisement