Export (0) Print
Expand All
Expand Minimize

vprintf, vwprintf

Write formatted output using a pointer to a list of arguments.

int vprintf(
   const char *format,
   va_list argptr 
);
int vwprintf(
   const wchar_t *format,
   va_list argptr 
);

Parameters

format
Format specification.
argptr
Pointer to list of arguments.

Return Value

vprintf and vwprintf return the number of characters written, not including the terminating null character, or a negative value if an output error occurs.

Remarks

Each of these functions takes a pointer to an argument list, then formats and writes the given data to stdout.

Security Note   Ensure that format is not a user-defined string. For more information, see Avoiding Buffer Overruns.

Generic-Text Routine Mappings

TCHAR.H routine _UNICODE & _MBCS not defined _MBCS defined _UNICODE defined
_vtprintf vprintf vprintf vwprintf

Requirements

Routine Required header Optional headers Compatibility
vprintf <stdio.h> and <stdarg.h> <varargs.h>* ANSI, Win 98, Win Me, Win NT, Win 2000, Win XP
vwprintf <stdio.h> or <wchar.h>, and <stdarg.h> <varargs.h>* ANSI, Win 98, Win Me, Win NT, Win 2000, Win XP

* Required for UNIX V compatibility.

For additional compatibility information, see Compatibility in the Introduction.

Libraries

All versions of the C run-time libraries.

See Also

Stream I/O Routines | vprintf Functions Overview | fprintf | printf | sprintf | va_arg | Run-Time Routines and .NET Framework Equivalents

Show:
© 2014 Microsoft