Wiki source for KeyPgVaArg


Show raw source

{{fbdoc item="title" value="VA_ARG"}}----
Returns the current argument from a variable argument list.

{{fbdoc item="syntax"}}##
//variable// = **va_arg** ( //argument_list//, [[DataType|datatype]] )
##
{{fbdoc item="desc"}}
The ##**va_arg**## macro allows the use of a variable number of arguments within a function:
- ##**va_arg**## returns the current argument in the list, ##//argument_list//##, with an expected data type of ##//datatype//##.
- Before first ##**va_arg**## use, ##//argument_list//## must be initialized with the command ##[[KeyPgVaFirst|va_first]]##.
- Unlike the C macro with the same name, ##**va_arg**## does not automatically increment ##//argument_list//## to the next argument within the list. Instead ##[[KeyPgVaNext|va_next]]## must be used to find the next argument in adjusting ##//argument_list//##.

Not supported when using ##[[CompilerOptgen|-gen gcc]]##. Use ##[[KeyPgCvaList|cva_list]]## variadic argument list type for cross platform compatibility.

{{fbdoc item="ex"}}
See the ##[[KeyPgVaFirst|va_first()]]## examples.

{{fbdoc item="lang"}}
- Not available in the //[[CompilerOptlang|-lang qb]]// dialect unless referenced with the alias ##**""__va_arg""**##.

{{fbdoc item="diff"}}
- New to ""FreeBASIC""

{{fbdoc item="see"}}
- ##[[KeyPgDots|... (Ellipsis)]]##
- ##[[KeyPgVaFirst|va_first]]##
- ##[[KeyPgVaNext|va_next]]##

{{fbdoc item="back" value="CatPgProcedures|Procedures"}}{{fbdoc item="back" value="CatPgVarArg|Variable Argument list"}}
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode