From: Shawn Hargreaves Newsgroups: comp.lang.c,comp.os.msdos.djgpp Subject: Re: '...' handling (with djgpp, although likely ubiquitous)... Date: Sun, 3 Aug 1997 20:25:20 +0100 Organization: None Distribution: world Message-ID: References: <33e5c2e0 DOT 51066140 AT news DOT bc1 DOT com> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 28 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Burton Radons/Lothloriel, Hollow Dreams writes: >char *rsprintf(const char *format, ...) >{ > va_list args; > char *buffer; > /* and on and on... */ >} > >What would I have to do to... err... set 'args' to '...'? 1: #include 2: At the start of this function call va_start(args, format); 3: At the end of the function call va_end(args); In between the calls to va_start() and va_end() you can work your way through the argument list with the va_arg() function, eg: int first = va_arg(args, int); double next = va_arg(args, double); char *another = va_arg(args, char *); etc. You just have to make sure you retrieve the parameters using the same types that were actually passed to the function... -- Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ Beauty is a French phonetic corruption of a short cloth neck ornament.