12

what is the default namespace in c++?

#include<iostream>
class B{
 .....
}
int main(){
.....
}

so what namespace is class B in?

jianzaixian
  • 233
  • 3
  • 5

1 Answers1

22

B is in the global namespace. It can be referred to unambiguously as ::B.

Eric Z provides an excerpt from C++03 here: https://stackoverflow.com/a/10269085

Community
  • 1
  • 1
Thomas L Holaday
  • 13,268
  • 6
  • 39
  • 51