2019-12-10 12:22 PM
hi everyone,
Can someone tell me if sprintf is ok in Keil? Tera term prints garbage value.
2 days ago I tried sprintf and it didn't work, I tried a simple declaration of a string and it worked.
what's the problem?
2019-12-10 12:32 PM
It's ok, I found it :D
2019-12-10 01:34 PM
You must provide an array to it, not uninitialized pointer.
Also take a note that sprintf() is unsafe, because it isn't aware of output buffer size. Better use snprintf().