Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!ll-xn!mit-eddie!uw-beaver!cornell!rochester!pt.cs.cmu.edu!andrew.cmu.edu!jv0l+
From: jv0l+@andrew.cmu.edu (Justin Chris Vallon)
Newsgroups: comp.lang.c
Subject: Args: var number & var types
Message-ID: 
Date: 11 May 88 20:43:48 GMT
Organization: Carnegie Mellon
Lines: 21

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:

{
  char c;
  int i;
  short s;
  long l;

  foo(0);     /* no optional argument */
  foo(1, c);  /* pass a character argument */
  foo(2, i);  /* pass an integer argument */
  foo(3, s);  /* pass a short arg */
  foo(4, l);  /* pass a long arg */
  foo(5, "Hello world"); /* pass a char* arg */
}

Could this be done?

-Justin
justin.vallon@andrew.cmu.edu