
- C Library - Home
- C Library - <assert.h>
- C Library - <complex.h>
- C Library - <ctype.h>
- C Library - <errno.h>
- C Library - <fenv.h>
- C Library - <float.h>
- C Library - <inttypes.h>
- C Library - <iso646.h>
- C Library - <limits.h>
- C Library - <locale.h>
- C Library - <math.h>
- C Library - <setjmp.h>
- C Library - <signal.h>
- C Library - <stdalign.h>
- C Library - <stdarg.h>
- C Library - <stdbool.h>
- C Library - <stddef.h>
- C Library - <stdio.h>
- C Library - <stdlib.h>
- C Library - <string.h>
- C Library - <tgmath.h>
- C Library - <time.h>
- C Library - <wctype.h>
- C Programming Resources
- C Programming - Tutorial
- C - Useful Resources
C Library - <stdarg.h>
The stdarg.h header defines a variable type va_list and three macros which can be used to get the arguments in a function when the number of arguments are not known i.e. variable number of arguments.
A function of variable arguments is defined with the ellipsis (,...) at the end of the parameter list.
Library Variables
Following is the variable type defined in the header stdarg.h −
Sr.No. | Variable & Description |
---|---|
1 |
va_list This is a type suitable for holding information needed by the three macros va_start(), va_arg() and va_end(). |
Library Macros
Following are the macros defined in the header stdarg.h −
Sr.No. | Macro & Description |
---|---|
1 |
void va_start(va_list ap, parmN)
This macro enables access to variadic function arguments. |
2 |
type va_arg(va_list ap, type)
This macro retrieves the next argument in the parameter list of the function with type type. |
3 |
void va_end(va_list ap)
This macro allows to end traversal of the variadic function arguments. |
4 |
void va_copy( va_list dest, va_list src )
This macro makes a copy of the variadic function arguments. |