Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!romp!auschs!awdprime!slug!uma From: uma@slug..austin.ibm.com Newsgroups: comp.lang.c Subject: Re: Grabbing "n" arguments in a function Message-ID: <2262@awdprime.UUCP> Date: 1 May 90 12:57:55 GMT References: <744@tmiuv0.uucp> Sender: news@awdprime.UUCP Reply-To: uma@awdprime.austin.ibm.com.UUCP () Organization: IBM AWD, Austin, TX Lines: 34 In article <744@tmiuv0.uucp> rick@tmiuv0.uucp writes: >Ok, I know this may be a stupid question, but I'll brave the arrows and >missiles hurled in my direction... > >What's the most portable way for a function to receive an arbitrary list of >arguments? The function must receive "n" arguments, all of which are char. >pointers: > I think the most portable way to achieve this is to use "varargs" feature as provided by the libc.a(on UNIX, I don't know about other OS). See /usr/include/varargs.h on UNIX System V any release. and also K&R C book describes how to use it too( 2nd edition of K&R C book pages 155-159). > .-------------------------------------------------------------------------. > / [- O] Rick Stevens (All opinions are mine. Everyone ignores them anyway.) \ >| ? +--------------------------------------------------------------------| >| V | uunet!zardoz!tmiuv0!rick (<-- Work (ugh!)) | >|--------+ uunet!zardoz!xyclone!sysop (<-- Home Unix (better!)) | >| uunet!perigrine!ccicpg!conexch!amoeba2!rps2 (<-- Home Amiga (Best!!) | > \ 75006.1355@compuserve.com (CIS: 75006,1355) (<-- CI$) / > `-------------------------------------------------------------------------' >"A day without sunshine is like..............night!" =============================================================================== Uma S. Pandey (contractor at IBM) Disc: "Any opinions are mine" Internal:uma@slug.austin.ibm.com VNET: sc10333 at ausvmq External: uunet!cs.utexas.edu!ibmaus!auschs!slug.austin.ibm.com!uma =============================================================================== =============================================================================== Uma S. Pandey (contractor at IBM) Disc: "Any opinions are mine" Internal:uma@slug.austin.ibm.com VNET: sc10333 at ausvmq T/L 793-4078. External: uunet!cs.utexas.edu!ibmaus!auschs!slug.austin.ibm.com!uma