vprintf
raw OCR
Writes formatted output to stdout.
Defined in header <stdarg.h>
Syntax
#include <stdarg.h>
int vprintf(const char *format, vajist arglist);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ | ■ |
Remarks
Available on UNIX System V.
The v...printf functions are known as alternate entry points for the ...printf functions. They behave exactly like their ...printf counterparts, but they accept a pointer to a list of arguments instead of an argument list.
See printf for details
vprintf accepts a pointer to a series of arguments, applies to each a
on format specifiers.
| format specifier format, and outputs the formatted data to stdout. There must be the same number of format specifiers as arguments. | contained in the format string pointed to by |
When you use the SS!=DS flag, vprintf assumes that the address being passed is in the SS segment.
Return value
vprint returns the number of bytes output. In the event of error, vprint returns EOF.
See also
Example
#include <stdio.h>
int vpf (char *fmt, ...)
{
va_list argptr;
int cnt ;
va_start (argptr, format);
cnt = vprintf (fmt, argptr);
va_end(argptr) ;
return (cnt);
}
int main (void)
int inumber =30;
float fnumber = 90.0;
char *string = "abc";
vpf("%d %f %s\n", inumber,fnumber,string) ;
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/stdarg.h/vprintf/
· short form /3.1/vprintf/