Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!mips!apple!equinox!jimi!big-joe.cs.unlv.edu!grover From: grover@big-joe.cs.unlv.edu (Kevin Grover) Newsgroups: comp.lang.c Subject: Re: Prototyping Question Keywords: Prototype Message-ID: <1991Jun14.234215.10808@unlv.edu> Date: 14 Jun 91 23:42:15 GMT References: <1991Jun14.122200.3710@socrates.umd.edu> Sender: news@unlv.edu (News User) Reply-To: grover@big-joe.cs.unlv.edu (Kevin Grover) Organization: UNLV Computer Science and Electrical Engineering Lines: 28 In article <1991Jun14.122200.3710@socrates.umd.edu>, cm315a@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@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@cs.unlv.edu | ISRI - Information Science Research Institute | | 73627.1677@compuserve.com | 4505 S. Maryland Parkway, Las Vegas NV 89154 | +---------------------------+-----------------------------------------------+