Prototyping Question

cmis 315 section 4011 cm315a at socrates.umd.edu
Fri Jun 14 22:22:00 AEST 1991


Here's a question on prototyping that has me (and the compiler)
baffled.  I have a function that takes one, or more parameters. If I
decalre it as:  void funct(char *, ... ) the calls to it with one or two
(or more) parameters passes without errors, but when the compiler
comes to the function itself, I get an error - not enough parameters. 
 
But on the otherhand if I declare it as: void funct(char *, int), the
calls to the function with one parameter cause an error.  Yes, the
prototype, the calls, and the definition of the function are in the
same file, or use the same header.h file as the declaration.
 
How does one get around this type of behavior? For the curious, it is
a call to an error handler, the error message, and an optional error
number - much like a printf() call.
 
- mike   cm315a at socrates.umd.edu [



More information about the Comp.lang.c mailing list