Question.7
A developer uses sprintf to format a sensor reading for UART output on an MCU with 2 KB RAM:
sprintf
char buf[32]; sprintf(buf, "Temp=%d.%dC Hum=%d%%", t_int, t_frac, hum);
Another developer suggests using manual digit conversion instead. Why?
Select Answer
sprintf is not available on ARM Cortex-M processors
sprintf pulls in a large library (~1–4 KB code + stack usage) that may not fit in 2 KB RAM and consumes significant stack space per call
sprintf produces wrong output for integers
There's no difference — both approaches use the same amount of memory