Freestanding C and bounded string functions
Practise memory copying, bounded strings and numeric conversion under tight firmware constraints.
View lesson accessAll lessonsWhat the lesson covers
The course lesson is called No libc here. The bootloader must fit in 8 KB and has no standard library, so Asha writes memcpy, memmove, strncpy, itoa and atoi herself, and meets every classic trap on the way.
- freestanding C
- memcpy vs memmove
- string functions
- itoa and atoi
- snprintf
Before you start
Question to think about: How does a memory copy contract change when source and destination overlap?
Preparation exercise: Specify success and failure behavior for empty, exact-fit and insufficient-capacity inputs before writing code.
This is an original public study prompt, not the paid lesson or its solution. The interactive course contains the walkthroughs, labs, exercises and recaps.
Related free reading
Test your understanding
Practice free firmware interview questions and mock interviews · Assess your readiness