Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>va_end() resets arg_ptr to null</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 va_end()                Resets arg_ptr to NULL

 #include   <stdarg.h>
 #include   <stdio.h>

 void va_end(arg_ptr);
 va_list arg_ptr;               Pointer to command-line arguments

    Functions in C can take a variable number of arguments; the
    va_start, va_arg, and va_end macros provide a portable way to read
    the arguments passed to them. Two versions of the macros are
    available: the macros in STDARG.H use the proposed ANSI C standard;
    the macros in VARARGS.H use the UNIX System V definition.

    Usually, a function takes a fixed number of required arguments,
    followed by a variable number of optional arguments. The required
    arguments are declared as normal parameters and can be reached
    through the parameter names. The optional arguments are reached by
    the STDARG.H or VARARGS.H macros. For the ANSI C (STDARG.H) macros:

              * va_start() sets arg_ptr, a pointer of type va_list,
                to the command-line arguments.

              * va_arg() retrieves a value from the location given by
                arg_ptr and increments arg_ptr to point to
                the next argument.

              * After all arguments have been read, va_end() sets
                arg_ptr back to NULL.

    See va_arg() for more information and examples.


See Also: va_arg() va_start() vfprintf() vprintf() vsprintf()

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