Skip to main content

Checkpoint: Full Layout Report

Challenge on lesson: Checkpoint: Reading the Machine

CHALLENGE
Difficulty: advanced+25 XP

Given ``c struct Record { char kind; long id; char active; double score; }; ` implement void program(void) printing exactly one layout line: ` kind@0 id@8 active@16 score@24 size:32 pad:0 ` All numbers must come from offsetof/sizeof measured on a locally defined identical struct (<stddef.h>); pad: is the *trailing* padding โ€” size minus (last member offset + last member size). Internal padding before score is not counted. On a second line, print the contract class of signed overflow by calling classify_overflow(), which you also implement and which returns exactly "undefined"`.

Back to lesson: Checkpoint: Reading the Machine