Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>va_arg</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
va_arg
va_end
va_start

Usage

   #include <stdarg.h>
   type va_arg(va_list arg_ptr, type);
   void va_end(va_list arg_ptr);
   void va_start(va_list arg_ptr, prev_parm);

   ANSI

Description

   These macros are used to maintain a list of arguments to be accessed
   within functions that accept a variable number of arguments (e.g. the
   vprintf function).

   va_list is a type of variable argument list defined in stdarg.h, together
   with the three macros, this allows variable argument lists to be
   processed by a function when it does not know the number of arguments
   being passed. The va_list array holds information required by va_arg and
   va_end. When a called function takes a variable argument list, it
   declares a variable of type va_list.

   va_start is first called to initialize the argument list, for which the
   parameter arg_ptr points to the first argument in the va_list. The other
   parameter prev_parm is the parameter preceding the first argument. After
   a call to va_start, a call to va_arg will evaluate data type from the
   location pointed to by arg_ptr and increment arg_ptr.

   va_end resets arg_ptr to NULL.

Example 

   See vfprintf.

Return Value

   va_arg returns the current argument.

   va_start and va_end evaluate to void.

See Also

   vprintf





Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson