What is the output of the following snippet?

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
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments