summaryrefslogtreecommitdiff
path: root/c,cc
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2015-12-19 00:44:44 +0100
committerPatrick Simianer <p@simianer.de>2015-12-19 00:44:44 +0100
commit6b562157bf50c515f5380ed659573aa40661fac7 (patch)
tree55261696d8975b4bb146b1416b35f1ec5e941f5c /c,cc
parent7375fdd7600fd83256d13644bc8b35dc2c71c2d0 (diff)
c,cc: base-member
Diffstat (limited to 'c,cc')
-rw-r--r--c,cc/base-member.cc32
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;
+}
+