1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include <iostream> class A { public: static int f() { return 1; } }; namespace this_a { int f() { return 2; } } int main() { A obj; int x = obj.f(); int y = A::f(); int z = this_a::f(); std::cout << x << y << z << '\n'; return 0; }
1
112