Final challenge: C
The last stop. Three problems that use the whole track: a word counter over a file, an editor with undo on the heap, and a memory model to predict.
- The skill
- Show that you can combine files, strings, the heap, data structures and function pointers in one program without leaking memory.
- You make
- A word frequency report over a song's lyrics, a text editor with undo and a memory diagram you predict.
Premium lesson
£7.99 a month or £59 a year. Cancel any time.
Builds on 32 Bug hunt: fix code you did not write. Free to try: C Foundations and the playground.
Cleared
Go back to
You can now
You can now
- Write, compile and debug C programs on your own
- Explain where every value lives: stack, heap or static memory
- Use pointers, structs, malloc, realloc and free without leaks
- Read and write files and parse text input
- Build linked lists, stacks, queues and hash tables
- Spot memory bugs and undefined behaviour before they bite
Step 1 of 4
exercise_1.c
You've reached the good stuff.
3 exercises in this lesson, checked as you type. Premium opens every lesson after Foundations, in all four courses.
C, 32-bit: int and pointers are 4 bytes