From 4c8377e5711e2c864c8754d1d6373c09da2ce7e1 Mon Sep 17 00:00:00 2001 From: Oskar Date: Wed, 21 Aug 2024 20:55:10 +0200 Subject: more exercises --- 4p30.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 4p30.cpp (limited to '4p30.cpp') 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 + +/* + * + * 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 = ⋙ + 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; +} -- cgit v1.2.3