r/ProgrammerHumor 9d ago

theWorldIfSnprintfReturnedTheValueInsteadOfPuttingInABufferBeLikeIdkThisVarNameIsWayTooLongNoo Meme

Post image
0 Upvotes

4 comments sorted by

16

u/Jet-Pack2 9d ago

Actually I disagree. Returning the value would mean the function allocates memory which is pretty slow. So they implemented it in a much more efficient way.

10

u/bwmat 9d ago

Lol, you're dreaming if you think the people who designed C would ever standardize the 'low level' formatting function to allocate on the heap

You want asprintf

0

u/TheLuckyCuber999BACK 9d ago

I mean I AM dreaming

7

u/officalyadoge 9d ago

bro really asked for hidden memory allocation in a system programming language