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++ Language Reference - va_arg va_end va_start 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);

   Description
   These  macros are used to maintain a list of arguments to be  accessed
   within  functions that accept a variable number of arguments (eg.  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
   arg_ptr  points  to the first argument in the va_list.  The  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.


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