vprintf, vfprintf, and vsprintf. McGraw-Hill The Complete Reference Fourth Edition
Reklamë
Reklamë
722
C + + : T h e C o m p l e t e R e f e r e n c e
A related function is getc( ).
vprintf, vfprintf, and vsprintf
#include <cstdarg>
#include <cstdio> int vprintf(char * format, va_list arg_ptr); int vfprintf(FILE * stream, const char *format, va_list arg_ptr); int vsprintf(char * buf, const char *format, va_list arg_ptr);
The functions vprintf( ), vfprintf( ), and vsprintf( ) are functionally equivalent to
printf( )
, fprintf( ), and sprintf( ), respectively, except that the argument list has been replaced by a pointer to a list of arguments. This pointer must be of type va_list, which is defined in the header <cstdarg> (or the C header file stdarg.h).
Related functions are va_arg( ), va_start( ), and va_end( ).
Chapter 26
The String and
Character Functions
723
Copyright © 2003 by The McGraw-Hill Companies. Click here for terms of use.
Shkarko
Reklamë