Free C11 examples
Choose a question. Run the C.
Two completed demonstrations for programmers exploring C memory. Run the fixed source and its checks in your browser, without an account or compiler setup. Each page also offers source to read, copy or download for your own editor.
Completed demonstrations
Alignment arithmetic · 18 checks
How much padding does a block need?
Compute the aligned header footprint and total block span with overflow-checked size_t arithmetic. The fixed C11 suite includes the 24-byte header, 13-byte request and 16-byte alignment example, plus invalid inputs and overflow cases.
Integer layout arithmetic only—not an allocator, storage or permission for typed access. The browser run uses fixed checks, not your calculator inputs.
Run the 18-check alignment example →Byte storage · 14 checks
How can a byte array hold metadata?
Copy a real Header into an unsigned char array with memcpy, then copy it back into a real object. Check bounds, metadata round trips and byte-payload preservation without header-pointer casts.
Portable byte storage, not arbitrary-object malloc or a portable wire format. Neither demonstration is a lesson solution or saves lesson progress.
Run the 14-check byte-storage example →Implement it yourself · 7 checks
A separate alignment lesson
Start with unfinished C and implement aligned reservations in a 64-byte arena. Edit and run the seven tests without registering, or download the starter and harness. Unlike the demonstrations, the starter is not expected to pass until you complete it.
Create an account to verify and save your work, then continue through the free limited preview. Local work does not sync automatically.
Try the free lesson →