#: 19981 S12/OS9/68000 (OSK)
22-May-94 21:22:14
Sb: C-arg count
Fm: Bob van der Poel 76510,2203
To: All
Help. I'm getting lost trying to write an ansi-c program using some functions
with variable args. Here is the problem...I have a general error printing
routine which really just calls fprintf(). I guess I'll have to change that to
vfprintf(), but assume that I have:
print_error(char *, ...)
{
/* do the va_args stuff */
/* set up the cursor */
/* print the error message with vfprint() */
/* close some files */
}
So far, fine. But what if I want to call this from another routine...
terminate(char *, ...)
{
/* call print_error() */
/* call the exit routine */
}
What I can't figure out is how to call print_error() from another routine which
also has a variable argument count. Guess I could just stuff the message in
terminate() into a string and just pass one arg. But there _should_ be another
way???
Press !>
|