diff options
author | Patrick Simianer <p@simianer.de> | 2015-12-19 00:44:44 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2015-12-19 00:44:44 +0100 |
commit | 6b562157bf50c515f5380ed659573aa40661fac7 (patch) | |
tree | 55261696d8975b4bb146b1416b35f1ec5e941f5c | |
parent | 7375fdd7600fd83256d13644bc8b35dc2c71c2d0 (diff) |
c,cc: base-member
-rw-r--r-- | c,cc/base-member.cc | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/c,cc/base-member.cc b/c,cc/base-member.cc new file mode 100644 index 0000000..4c3a86f --- /dev/null +++ b/c,cc/base-member.cc @@ -0,0 +1,32 @@ +/* + * template.cpp + * + * Patrick Simianer <p@simianer.de> + * YYYY-MM-DD + */ + +#include <iostream> + +using namespace std; + +class A +{ + public: + int a; +}; + +class B : public A +{ + public: + int b; +}; + +int main(int argc, char const* argv[]) +{ + B b; + b.b = 1; + b.a = 2; + cout << b.a << endl; + return 0; +} + |