Why not a varargs declaration?

rf at wu1.UUCP rf at wu1.UUCP
Tue Nov 1 07:58:47 AEST 1983


Maybe C should provide a standard way to pass a variable number
of arguments to a function.  One could provide a varags
declaration:

   varargs f() . . .

I'm aware that it would be difficult to provide a quick way to
do this on all machines, but the capability seems useful enough
so that the loss of execution time might be justifiable.  It
would, for instance, decrease the effort required to port an i/o
library.

A possible alternative might be to provide an Ada-like aggregate
notation.  Then one might write:

   fprintf (outfile, "%s %d\n", (@string, &i@));

The (@ . . . @) notation would assemble its arguments in
ascending order in main memory.  This might provide a fairly
clean way to pass variable numbers of parameters.
   
   
   				Randolph Fritz
				Western Union Telegraph



More information about the Comp.lang.c mailing list