Login
From:
Max Bernstein
(Uncensored)
subscribe
How to use snprintf | Max Bernstein
https://bernsteinbear.com/blog/snprintf/
links
backlinks
Roast topics
Find topics
Find it!
The sprintf family of functions (sprintf, snprintf, vsnprintf, …) have this little-known feature to what size your buffer should be. In cases where you don’t have a fixed upper bound, this is really useful.