Plan
This lab opens in week 6. The full step-by-step page, the starter repository and the tests are published before that Monday; the plan below is final.
- swap.c: a
swap(int *a, int *b)that works, and a comment explaining why the by-value version cannot. - copy.c: copy a string with
mallocand a loop, uppercase the copy, free it; valgrind must report no leaks. - leaks.c: a program with three deliberate memory errors that you find with valgrind and fix.
- filter.c: grayscale and reflect filters on a 24-bit BMP, reading and writing the file with
fread/fwrite. - Explore notebook: view the bytes of a BMP header with Python and check your C program’s output pixel by pixel.
How it works
Same loop as every lab: accept on Classroom 50, open in Codespaces, solve the TODOs, python3 check.py until green, git push. See how labs work and the setup guide.