Prototyping Question

Kevin Grover grover at big-joe.cs.unlv.edu
Sat Jun 15 09:42:15 AEST 1991


In article <1991Jun14.122200.3710 at socrates.umd.edu>, cm315a at socrates.umd.edu (cmis 315 section 4011) writes:
) 
) 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 [

What compiler??  I use that sort of prototype all the time on PC (Turbo C,
Borland C++) and UNIX (gcc).  I have had no problems.

-- 
  +---------------------------+-----------------------------------------------+
  | Kevin O. Grover           | UNLV Computer Science and Electrical Eng.     |
  | grover at cs.unlv.edu        | ISRI - Information Science Research Institute |
  | 73627.1677 at compuserve.com | 4505 S. Maryland Parkway, Las Vegas NV 89154  |
  +---------------------------+-----------------------------------------------+



More information about the Comp.lang.c mailing list