summaryrefslogtreecommitdiff
path: root/4p30.cpp
diff options
context:
space:
mode:
Diffstat (limited to '4p30.cpp')
-rw-r--r--4p30.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/4p30.cpp b/4p30.cpp
new file mode 100644
index 0000000..8a93455
--- /dev/null
+++ b/4p30.cpp
@@ -0,0 +1,32 @@
+#include <iostream>
+
+/*
+ *
+ * 4.30
+ *
+ * Wow! This was a tricky question.
+ */
+
+int f() {
+ return 1;
+}
+
+struct ddd {
+ int mem[10];
+};
+
+int main () {
+
+ struct ddd ggg;
+ struct ddd *p = &ggg;
+ int i = 0;
+ int x = 0;
+ int y = 0;
+ unsigned int a = 0;
+ unsigned int b = 0;
+ std::cout << sizeof (x) + y << std::endl;
+ std::cout << sizeof (p->mem[i]) << std::endl;
+ std::cout << (sizeof (a) < b) << std::endl;
+ std::cout << sizeof (f()) << std::endl;
+ return 0;
+}