[ create a new paste ] login | about

Link: http://codepad.org/JRTvzDLk    [ raw code | output | fork ]

C++, pasted on Feb 22:
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;
}


Output:
1
112


Create a new paste based on this one


Comments: