summaryrefslogtreecommitdiff
path: root/c,cc
diff options
context:
space:
mode:
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;
+}
+