vprintf()
Syntax:
#include <stdarg.h> #include <stdio.h> int vprintf( char *format, va_list arg_ptr );
Description:
The function is very much like |printf()|, |fprintf()|, and |sprintf()|. The difference is that the argument list is a pointer to a list of arguments. va_list is defined in STDARG.H, and is also used by |va_arg()|.
Example:
void error( char *fmt, ... ) {
va_list args;
va_start( args, fmt );
fprintf( stderr, "Error: " );
vfprintf( stderr, fmt, args );
fprintf( stderr, "\n" );
va_end( args );
exit( 1 );
}
Related Topics:
vprintf(), vfprintf(), vsprintf(), printf(), fprintf(), sprintf()



