I want to report some error messages to the user of my program. I have found that using Variadic function is the most scalable method to use, but I am not sure how to put it together, this is what I have so far.
Many thanks for any suggestions,
DEV_FAILED, /* Device failed to open */
EX_FAILED, /* Cannot open library */
HOST_INFO_ERR, /* Cannot get host information */
void report_error(FILE *out, const char *fmt, ...)
vfprintf(out, fmt, ap);
"%s: Invalid range of %ld near line %d", __func__, range, __LINE__);