An example of use of varargs in C
Remember that arguments are passed on the stack. The va_start function contains the “magic” code to initialize the va_list with the correct stack pointer. It must be passed the last named argument in the function declaration or it will not work. What va_arg does is use this saved stack pointer, and extract the correct amount … Read more