What you need is a variadic function, together with vprintf (unless you really want to parse the format string yourself). Here is an example they I have shamelessly ripped from the GNU libc manual which seems to be along similar lines as to what you want to do.
Example usage from libc manual:
eprintf (const char *template, ...)
extern char *program_invocation_short_name;
fprintf (stderr, "%s: ", program_invocation_short_name);
va_start (ap, count);
vfprintf (stderr, template, ap);
starg.h gives you the macros required to deal with variable numbers of arguments.
eprintf ("file `%s' does not exist\n", filename);
The "..." in the function definition defines the function as having a variable number of arguments from that point.
va_start sets up a pointer to the first argument.
vfprintf uses the format string supplied plus the argument pointer to do the business.
va_end signifies that the argument list is finished with.
I imagine that program_invocation_shortname thing needs sterr.h.