va_arg


Moving variable for scanning argument list

[Classification]

Standard library

[Syntax]

#include <stdarg.h>

type va_arg(va_list ap, type);

[Description]

This function returns the argument indicated by variable ap, and advances variable ap to indicate the next argument. For the type of va_arg, specify the type converted when the argument is passed to the function. With the C compiler specify the int type for an argument of char and short types, and specify the unsigned int type for an argument of unsigned char and unsigned short types. Although a different type can be specified for each argument, stipulate "which type of argument is passed" according to the conventions between the called function and calling function.

Also stipulate "how many functions are actually passed" according to the conventions between the called function and calling function.