Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.19 KB | None | 0 0
  1. namespace ns {
  2. int f();
  3. class C {
  4.  friend int f();
  5. public:
  6.  C(int n=0) : x(n) {}
  7. private:
  8.  int x;
  9.  };
  10. }
  11. int ns::f() {
  12.  ns::C c;
  13.  return c.x;
  14. }
  15. int main() {
  16.  ns::f();
  17.  return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement