VA_ARG
- Source: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgVaArg
- Last revised: 2019-03-10
Returns the current argument from a variable argument list.
Syntax
` variable = va_arg ( argument_list, datatype )
`
Description
The va_arg macro allows the use of a variable number of arguments within a function:
va_argreturns the current argument in the list,argument_list, with an expected data type ofdatatype.- Before first
va_arguse,argument_listmust be initialized with the commandva_first. - Unlike the C macro with the same name,
va_argdoes not automatically incrementargument_listto the next argument within the list. Insteadva_nextmust be used to find the next argument in adjustingargument_list.
Not supported when using -gen gcc. Use cva_list variadic argument list type for cross platform compatibility.
Examples
See the va_first() examples.
Dialect Differences
- Not available in the -lang qb dialect unless referenced with the alias
__va_arg.
Differences from QB
- New to FreeBASIC
See also
... (Ellipsis)va_firstva_next
Back to DocToc