passing variable arguments
Olaf Schlueter
schlut at oski
Tue Jun 12 10:17:48 AEST 1990
In article <1990Jun8.165259.8368 at agate.berkeley.edu> dankg at tornado.Berkeley.EDU (Dan KoGai) writes:
> In article <353 at ankh.ftl.fl.us> chin at ankh.ftl.fl.us (Albert Chin) writes:
> >How does printf() work. I believe there is some way in C to obtain the
> On C convention, arguments are pushed to the stack right to left
> order before it jumps to the function.
> On Ansi C, you can use <stdarg.h> macro package to write variable
> argument function. And variable argument is implied by "...". Here's simple
> example:
[good example, which everyone shall use from now on and forever, deleted]
What Dan means with 'C convention' has never been an assured standard and
everyone should avoid this. It is possible to use another parameter passing
scheme even in K&R (prae ANSI) C. Before ANSI C there has been no portable
way to write a routine like printf in C. We should be glad that this has
changed and forget about the elder days. Even with parameter passing on
stack assured, how will you port a programm written on a compiler with
32 Bit int's to one with a different int size ?
Mfg, (avoid E-Mail whenever possible, I have to pay for it)
--
Olaf Schlueter, Sandkuhle 4-6, ! subnet: schlut at oski
2300 Kiel 1, West Germany ! USENET/DNET/EUNET: schlut at tpki.de
(soon: Germany ?!) ! ZERBERUS: schlut at KBBS
--- Und bitterer noch als der Tod ist das Weib (Pred 7,26) --------
More information about the Comp.lang.c
mailing list