[ create a new paste ] login | about

Project: ncu
Link: http://ncu.codepad.org/czvUx7p4    [ raw code | output | fork ]

GiM - C++, pasted on Jun 10:
#include <cstdio>

// May the force be with you
#define private public
#define protected public
#define class struct

class Foo {
  int foo;
public:
  int getFoo() { return foo; }
  int setFoo(int x) { return (foo = x); }
};

class Bar : private Foo {
public:
  int getBar() { return getFoo(); }
  int setBar(int x) { return setFoo(x); }
};

int main()
{
  Bar b;
  b.setBar(10);
  printf("%d\n", b.foo);
  return 0;
}


Output:
1
10


Create a new paste based on this one


Comments: