Args: var number & var types

Joseph Nathan Hall jnh at ece-csc.UUCP
Fri May 13 02:08:05 AEST 1988


In article <cWW=o4y00XcRh2E04h at andrew.cmu.edu> jv0l+ at andrew.cmu.edu (Justin Chris Vallon) writes:
>Is there any way to declare a function to have two arguments point to the same
>place in the stack-frame?  Let's say that I want to write the implementation of
>foo which takes an optional argument based upon the first parameter:
...

You can do this by a) using a variable-length argument list or b) passing your
argument(s) in a union.  Approach b) wastes a little space but is more
conventional, hence more easily understood and probably easier to port between
older compilers.

-- 
v   v sssss|| joseph hall                      || 201-1D Hampton Lee Court
 v v s   s || jnh at ece-csc.ncsu.edu (Internet)  || Cary, NC  27511
  v   sss  || the opinions expressed herein are not necessarily those of my
-----------|| employer, north carolina state university . . . . . . . . . . . 



More information about the Comp.lang.c mailing list