Write formatted output to stdout.
This function is compatible with the following targets:
|
|
#include <stdio.h>
int vprintf(const char *format, va_list arg);Parameters:
Parameters for this facility are:
For specifications concerning the output control string and conversion specifiers please see: "Output Control String and Conversion Specifiers."
Return:
vprintf() returns the number of characters written or a negative value if it failed.
"Wide Character and Byte Character Stream Orientation"
Example of vprintf() usage.:#include <stdio.h>
#include <stdarg.h>
int pr(char *, ...);
int main(void)
{
int a = 56;
double f = 483.582;
static char s[] = "Metrowerks";
// output a variable number of arguments to stdout
pr("%15s %4.4f %-10d*\n", s, f, a);
return 0;
}
// pr() formats and outputs a variable number of arguments
// to stdout using the vprintf() function
int pr(char *format, ...)
{
va_list args;
int retval;
va_start(args, format); // prepare the arguments
retval = vprintf(format, args);
va_end(args); // clean the stack
return retval;
}
Output:
Metrowerks 483.5820 56 *
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 16, 2000