I attended a technical interview a few days ago, and I was asked How does the C compiler implments function with Variable number of arguments? How does it pass the on the st
It implements them using the va_ macros - for example va_start. Exactly what these macros do is implementation defined - in other words it will vary from CPU architecture to architecture, and from compiler to compiler. But they must play tricks with the C call stack. Typically, this will involve taking the address of the last named parameter as a base, and then accessing the variadic parameters by performing pointer arithmetic on this base.