I want to create this function, but ... parameter lists can't be passed around this way. What is the proper way to go about this?
And yes, I know some compilers provide an 'asprintf'. My question is not what function I should be using, but rather how to get parameter passing like this to work.
// Allocates a formmated string
char *msprintf(const char *format, ...)
{
int size = snprintf(NULL, 0, format, ...);
char *buf = (char*)malloc(size);
snprintf(buf, size, format, ...);
return buf;
}