Skip to content
UnderDunn Courses

C Memory Lab

Programming FoundationsLab 2 of 375 minutesLab included

Download c-memory-v1.0.0.tar. Expected SHA-256:

4b60bdc55093808418aeb46bb3d485ed19d454f2ee773ea5ff7ac9122f91e3e1

Verify, extract into ~/underdunn-labs/c-memory, and enter the version directory. Read memory-observer.c. Predict the element count, values, pointer size, and address difference between adjacent elements. Compile your own copy:

Terminal window
gcc -Wall -Wextra -Wpedantic -O0 -g -o my-observer memory-observer.c
./my-observer

Explain why the array has five elements, why the pointer size differs from the array size, and why index five is invalid. Do not test an out-of-bounds read; undefined behavior is not required evidence.

Construct UNDERDUNN{COUNT_elements_POINTER_byte_pointer} using decimal values. Expected flag hash:

6ee109becb04da23264c38886fee3be24c745be492037176b5eba2bf6e4f33be

Verify with printf '%s' 'UNDERDUNN{your_candidate}' | sha256sum. Reset by re-extracting the verified archive.