Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!samsung!zaphod.mps.ohio-state.edu!usc!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.lang.c Subject: Re: Passing Variable Numbers of Arguments Message-ID: <1991Feb11.225515.18448@athena.mit.edu> Date: 11 Feb 91 22:55:15 GMT References: <5196@media-lab.MEDIA.MIT.EDU> Sender: news@athena.mit.edu (News system) Organization: Massachusetts Institute of Technology Lines: 23 If you're using an ANSI C compiler that has , then see the documentation in K&R 2 (and whatever books you have that talk about ANSI C) that talks about variable-argument functions. If you're not, and your system has , then see the man page for varargs for information about how to do variable-argument functions. In fact, you probably *are* going to end up using vprintf rather than being able to call sprintf and convince it that some of youre function's arguments are the arguments that it should use. But that isn't such a big deal if you have vprintf. If you don't there are public domain implementations of it all over the place, including one in comp.sources.misc or comp.sources.unix (I forget which). I've found that a good place to see how variable argument stuff works with is the source code for GNU awk. -- Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710