Question.5
A developer allocates a buffer for converting a uint32_t to a decimal string:
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?
uint32_t
Select Answer
Works fine — 5 bytes is enough for any integer
Buffer overflow — the value requires 10 digits + null terminator = 11 bytes, but only 5 are allocated
The function truncates the value to fit the buffer
Compilation error — the buffer size is checked at compile time