I am slightly confused by the using namespace x in c++. Why would it be incorrect in this context? Does "using namespace" only applicable to the other files we are #including?
#include <iostream>
using namespace A;
namespace A {
void print() {
std::cout << "From namespace A" << std::endl;
}
}
namespace B {
void printB() {
std::cout << "From namespace B" << std::endl;
}
}
int main() {
print();
printB();
}