Menu

#74 Variable Arg Function

OnBoard_C
open
nobody
OnBoard C (33)
5
2005-04-11
2005-04-11
Anonymous
No

The following sequence:

void vx(char p1, ...)
{
char p;
p = p1;
}

doesn't compile - the "..." apparently causes the
parameter list to be discarded. The following works:

void vx(char p1,...);
void vx(char p1)
{
char p;
p = p1;
}

but the call "vx('a'. 'b');" fails. The only form that
seems to work is:

void vx(char p1,...);
void vx(char p1)
{
char p;
p = p1;
}
void vx(char p1,...);

Discussion

  • Steve Little

    Steve Little - 2005-04-12

    Logged In: YES
    user_id=583634

    I second this. Again, it might already be have been reported.

     
  • John Wilund

    John Wilund - 2005-04-19

    Logged In: YES
    user_id=574706

    I seccond this too.
    /John

     

Log in to post a comment.