Last Updated on May 3, 2022 by Admin 3
What is the output of the following snippet?
#include <iostream> namespace SpaceA { int A; } namespace SpaceB { int A; } using namespace SpaceA, SpaceB; int main() { SpaceA::A = SpaceB::A = 1; std:cout << A + 1; }
- Compilation fails
0
1
2