Page 1 of 1

How to print the value of the i variable inside namespace B?

Posted: Wed Jul 13, 2022 7:51 pm
by answerhappygod
namespace A{
int var = 10;
namespace B{
int i = 15;
}
}
a) cout<<A::i;
b) cout<<B::i;
c) cout<<A::B::i;
d) cout<<i;