The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group


vfprintf, vprintf, vsnprintf, vsprintf - format output of a stdarg argument list


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

int vfprintf(FILE *stream, const char *format, va_list ap);
int vprintf(const char *format, va_list ap);
int vsnprintf(char *s, size_t n, const char *format, va_list ap);
int vsprintf(char *s, const char *format, va_list ap);


The vprintf(), vfprintf(), vsnprintf() and vsprintf() functions are the same as printf(), fprintf(), snprintf() and sprintf() respectively, except that instead of being called with a variable number of arguments, they are called with an argument list as defined by <stdarg.h>.

These functions do not invoke the va_end macro. As these functions invoke the va_arg macro, the value of ap after the return is indeterminate.


Refer to printf().


Refer to printf().




Applications using these functions should call va_end(ap) afterwards to clean up.




printf(), <stdarg.h>, <stdio.h>.


Derived from Issue 1 of the SVID.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]