vprintf
, vfprintf
, vsprintf
---format argument listSynopsis
#include <stdio.h> #include <stdarg.h> int vprintf(const char *fmt, va_list list); int vfprintf(FILE *fp, const char *fmt, va_list list); int vsprintf(char *str, const char *fmt, va_list list); int vsnprintf(char *str, size_t size, const char *fmt, va_list list); int _vprintf_r(void *reent, const char *fmt, va_list list); int _vfprintf_r(void *reent, FILE *fp, const char *fmt, va_list list); int _vsprintf_r(void *reent, char *str, const char *fmt, va_list list); int _vsnprintf_r(void *reent, char *str, size_t size, const char *fmt, va_list list);
Description
vprintf
, vfprintf
, vsprintf
and vsnprintf
are (respectively)
variants of printf
, fprintf
, sprintf
and snprintf
. They differ
only in allowing their caller to pass the variable argument list as a
va_list
object (initialized by va_start
) rather than directly
accepting a variable number of arguments.
Returns
The return values are consistent with the corresponding functions:
vsprintf
returns the number of bytes in the output string,
save that the concluding NULL
is not counted.
vprintf
and vfprintf
return the number of characters transmitted.
If an error occurs, vprintf
and vfprintf
return EOF
. No
error returns occur for vsprintf
.
Portability
ANSI C requires all three functions.
Supporting OS subroutines required: close
, fstat
, isatty
,
lseek
, read
, sbrk
, write
.
Packaging copyright © 1988-2000 OAR Corporation
Context copyright by each document's author. See Free Software Foundation for information.