Question.5
A developer allocates a buffer for converting a uint32_t to a decimal string:
uint32_t
char str[5]; uint32_t val = 4294967295; // Max uint32_t my_itoa(val, str);
The maximum value of uint32_t is 4,294,967,295 (10 digits). What happens?
Select Answer
Buffer overflow — the value requires 11 bytes, but only 5 are allocated
Works fine — 5 bytes is enough for any integer
The function truncates the value to fit the buffer
Compilation error — the buffer size is checked at compile time