codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#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; }
Private
[
?
]
Run code
Submit