- C Library - <time.h>
- C Library - <string.h>
- C Library - <stdlib.h>
- C Library - <stdio.h>
- C Library - <stddef.h>
- C Library - <stdarg.h>
- C Library - <signal.h>
- C Library - <setjmp.h>
- C Library - <math.h>
- C Library - <locale.h>
- C Library - <limits.h>
- C Library - <float.h>
- C Library - <errno.h>
- C Library - <ctype.h>
- C Library - <assert.h>
- C Library - Home
C Standard Library Resources
C Programming Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
C Library - <stdarg.h>
The stdarg.h header defines a variable type va_pst 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 elppsis (,...) at the end of the parameter pst.
Library Variables
Following is the variable type defined in the header stdarg.h −
Sr.No. | Variable & Description |
---|---|
1 |
va_pst 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 |
This macro initiapzes ap variable to be used with the va_arg and va_end macros. The last_arg is the last known fixed argument being passed to the function i.e. the argument before the elppsis. |
2 |
This macro retrieves the next argument in the parameter pst of the function with type type. |
3 |
This macro allows a function with variable arguments which used the va_start macro to return. If va_end is not called before returning from the function, the result is undefined. |