delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/09/29/05:45:17

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help with variable argument-list (va_list)
Date: 29 Sep 2000 09:37:34 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 17
Message-ID: <8r1nsu$q93$1@nets3.rz.RWTH-Aachen.DE>
References: <39D39533 DOT 33F46DA4 AT wxs DOT nl>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 970220254 26915 137.226.32.75 (29 Sep 2000 09:37:34 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 29 Sep 2000 09:37:34 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

[F'up2 limited to DJGPP newsgroup...]

In comp.os.msdos.djgpp A. Jans-Beken <jansb000 AT wxs DOT nl> wrote:
> I am trying to create a wrapper for a function that uses a variable
> argument list (like printf).

You can't do that, at least not in a portable way. You cannot
construct a variable argument list at run time. A function can take a
variable number of arguments, but no funcation can *call* another with
a number of arguments that is not fixed at compile time.

That's why there is the function 'vprintf()', too. Look it up
(together with the <stdarg.h> macros like va_arg(), va_start() and
friends) in your favourite textbook or tutorial.
-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019