Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

va_start - initialize variable argument list

&pagelevel(4)&pagelevel

Syntax

#include <stdarg.h>

Optional
#include <varargs.h> (End)

void va_start(va_list ap, parmN); 

Description

The va_start, va_arg and va_end macros allow portable procedures that accept variable argument lists, as defined in stdarg.h, to be written. They are used to process a list of arguments which may vary in number and type at each function call.

va_start initializes the variable argument list ap for subsequent calls to va_arg and va_end.

ap is a pointer to the argument list.

parmN is the name of the last argument of the variable argument list. Functions which process variable argument lists must define at least one argument. 

Return val.

Number of output characters 


if successful.

0

if an error occurs.                    

Notes

If parmN has an invalid data type or its type does not match the current argument, the behavior is undefined.

Compatibility of argument types is supported by the C runtime system to the extent that similar types are stored in the same way in the parameter list, i.e.: all unsigned types (including char) are represented as unsigned int (right-justified in a word), and all other integer types are represented as int (right-justified in a word). float is represented as double (right-justified in a doubleword).

See also

va_arg(), va_end(), stdarg.h, varargs.h.