(libc.info.gz) Variadic Functions

Info Catalog (libc.info.gz) Consistency Checking (libc.info.gz) Language Features (libc.info.gz) Null Pointer Constant
 
 A.2 Variadic Functions
 ======================
 
 ISO C defines a syntax for declaring a function to take a variable
 number or type of arguments.  (Such functions are referred to as
 "varargs functions" or "variadic functions".)  However, the language
 itself provides no mechanism for such functions to access their
 non-required arguments; instead, you use the variable arguments macros
 defined in 'stdarg.h'.
 
    This section describes how to declare variadic functions, how to
 write them, and how to call them properly.
 
    *Compatibility Note:* Many older C dialects provide a similar, but
 incompatible, mechanism for defining functions with variable numbers of
 arguments, using 'varargs.h'.
 

Menu

 
* Why Variadic                Reasons for making functions take
                                  variable arguments.
* How Variadic                How to define and call variadic functions.
* Variadic Example            A complete example.
 
Info Catalog (libc.info.gz) Consistency Checking (libc.info.gz) Language Features (libc.info.gz) Null Pointer Constant
automatically generated by info2html