variable number of strings passed to function - how?

Chris Torek chris at mimsy.UUCP
Sat Oct 22 07:44:56 AEST 1988


In article <3533 at ihuxz.ATT.COM> burris at ihuxz.ATT.COM (Burris) writes:
>In the C language arguments are placed on the stack in reverse order ....

In the C language there may or may not *be* a stack.

Pyramid's compiler places the first 12 (or so; it was 12 when we had one)
`simple' arguments in registers.  The machine can take the address of
registers, so the first 12 arguments are in fact contiguous at increasing
addresses.  The 13th and succeeding arguments, however, are at some other
location entirely (on the data stack---the registers are stored on the
control stack, when the current window overflows).

This is why you must use <varargs.h> (or <stdarg.h>).
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.lang.c mailing list