Hacker News new | ask | show | jobs
by trealira 758 days ago
Yes, I was also confused at first.

The closest C function to this one is asprintf, because this function gives you back a new, separate string, which you may or may not decide to print. Just imagine if asprintf simply returned a char* pointing to an allocation by malloc, instead of taking an extra char ** as an out parameter.

  char *my_sprintf(const char *, ...);