13

what is the default namespace in c++?

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

so what namespace is class B in?

jianzaixian
  • 243
  • 3
  • 5

1 Answers1

24

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,614
  • 6
  • 40
  • 51