by anonymousiam · 2y ago · 0 comments
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 *, ...); void my_sprintf(char* format, ???) {
sprintf(format, ???);
}Either way, the format string discussion for the printf familiy of functions is very similar between them
Thanks!