diff options
author | Oskar <[email protected]> | 2024-08-21 20:55:10 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-08-21 20:55:10 +0200 |
commit | 4c8377e5711e2c864c8754d1d6373c09da2ce7e1 (patch) | |
tree | d3c8703a39cb8bd2f1a3b22c868141f8eba35e95 /4p30.cpp | |
parent | e747f69eb9b34f2c99472ca1cd17e049c1b74c9c (diff) |
more exercises
Diffstat (limited to '4p30.cpp')
-rw-r--r-- | 4p30.cpp | 32 |
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 = ⋙ + 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; +} |