Path: utzoo!utgpu!water!watmath!clyde!att!rutgers!ucsd!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.lang.c Subject: Re: variable number of strings passed to function - how? Message-ID: <289@auspex.UUCP> Date: 23 Oct 88 21:16:10 GMT References: <434@tutor.UUCP> <3533@ihuxz.ATT.COM> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 18 >In the C language arguments are placed on the stack in reverse order >such that the first argument is the lowest index off of the stack pointer. *AHEM* No, in certain *implementations* of the C language arguments are placed onto the stack in reverse order.... In other implementations some of them are stuffed into registers. The closest things to a portable way of doing a function taking a variable number of arguments are: 1) "varargs" - present on many (most?) UNIX systems' C implementations, and possibly on other implementations as well (see VARARGS(n), for some value of "n", in the UNIX documentation; if you don't have UNIX, look somewhere else). 2) "stdargs" - specified by ANSI C, so probably present in many microcomputer implementations.