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 pulls in a large library that may not fit in 2 KB RAM
sprintf is not available on ARM Cortex-M processors
sprintf produces wrong output for integers
There's no difference — both approaches use the same amount of memory