Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!psuvax1!rutgers!deejay!yachaya!brontolo!peter From: peter@brontolo.sublink.ORG (Network administrator) Newsgroups: comp.lang.c Subject: Re: Grabbing "n" arguments in a function Summary: Not ever... Message-ID: <347@brontolo.sublink.ORG> Date: 28 Apr 90 21:55:37 GMT References: <744@tmiuv0.uucp> <559@dplace.UUCP> <297@ndla.UUCP> Organization: SINDATA srl Unix site in Vimercate, Italy Lines: 29 In article <297@ndla.UUCP>, platt@ndla.UUCP (Daniel E. Platt) writes: ] In article <559@dplace.UUCP>, djl@dplace.UUCP (Dave Lampe) writes: ] > rick@tmiuv0.uucp writes: ] > ] > >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: ] > ] > > char *weirdfunc(char *arg1, char *arg2, ... char *argn) { ] > ] ...In your case ] you'ld continue popping the things from the stack until you got a NULL. Dan's method to get arguments from the function's stack is very usefull, and is worth ok on every OS and C compiler I have tried, exept for the DEC's RISC one. Does anybody out there know how to do the same variable argument call (WITHOUT "varargs", please! [it doesn't work, too!!!!!]) under MIPS RISC workstation (or DEC's one) ????????? Thank you Peter -- Peter Komanns ************- SINDATA srl -***************** Via Rovereto 17 | BANG ..!rutgers!deejay!yachaya!brontolo!peter 20059 Vimercate MI ITALY | SUBLINK peter@brontolo (voice) +39-39-6083733 (fax) +39-39-6083957