Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!sdrc!scjones From: scjones@sdrc.UUCP (Larry Jones) Newsgroups: comp.lang.c Subject: Re: Variable number of arguments to a function Keywords: c, variable number of arguments, sprintf Message-ID: <1380@sdrc.UUCP> Date: 6 May 90 19:00:03 GMT References: <3697@iitmax.IIT.EDU> Organization: SDRC, Cincinnati Lines: 28 In article <3697@iitmax.IIT.EDU>, thssvhj@iitmax.IIT.EDU (vijay hemraj jadhwani) writes: > Below are the three different cases of function references (or usage). > Case 1. ACTUAL NO. OF ARGUMENTS < NO. OF ARGUMENTS IN THE FUNC. DEFINITION > > Case 2. ACTUAL NO. OF ARGUMENTS > NO. OF ARGUMENTS IN THE FUNC. DEFINITION > > Case 3: ARGUMENT TYPE IS DIFFERENT THAN THE EXPECTED ARGUMENT TYPE > > Questions - > 1. Which of the above 3 cases are correct and which are not? Why ? None of them is correct. The number and type of arguments in a call MUST match the number and type in the definition. See the ANSI C standard. > 2. If I want to remove any "lint" warnings, for argument number mismatch, > what should I do ? i.e. I need a scheme to be able to pass variable > number of arguments to myprint(). Also it would be nice , if I could > also have an ability to pass any "type" of arguments to myprint(). Look up or and vprintf(). ---- Larry Jones UUCP: uunet!sdrc!scjones SDRC scjones@SDRC.UU.NET 2000 Eastman Dr. BIX: ltl Milford, OH 45150-2789 AT&T: (513) 576-2070 "You know how Einstein got bad grades as a kid? Well MINE are even WORSE!" -Calvin