Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watdaisy.UUCP Path: utzoo!watmath!watdaisy!gvcormack From: gvcormack@watdaisy.UUCP (Gordon V. Cormack) Newsgroups: net.lang.c Subject: Re: number of arguments function for 4.1bsd VAX cc(1) -- TYPO FIX Message-ID: <7005@watdaisy.UUCP> Date: Sun, 24-Feb-85 11:57:59 EST Article-I.D.: watdaisy.7005 Posted: Sun Feb 24 11:57:59 1985 Date-Received: Wed, 27-Feb-85 04:06:00 EST References: <271@oliveb.UUCP> Organization: U of Waterloo, Ontario Lines: 25 This sample program illlustrates a much simpler way to find the number of arguments to a function on the VAX, and to access an indeterminate number of arguments. #include main() { pr_args(1); pr_args(1, 2, 3); pr_args(1, 2, 3, 4); } pr_args(args) int args; { int nargs, *argp, i; argp = &args; nargs = argp[-1]; printf("Called with %d args: ", nargs); for(i=0; i