vfprintf, vfwprintf
Visual Studio .NET 2003
Write formatted output using a pointer to a list of arguments.
int vfprintf( FILE *stream, const char *format, va_list argptr ); int vfwprintf( FILE *stream, const wchar_t *format, va_list argptr );
Parameters
- stream
- Pointer to FILE structure.
- format
- Format specification.
- argptr
- Pointer to list of arguments.
For more information, see Format Specifications.
Return Value
vfprintf and vfwprintf 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 stream.
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 |
|---|---|---|---|
| _vftprintf | vfprintf | vfprintf | vfwprintf |
Requirements
| Routine | Required header | Optional headers | Compatibility |
|---|---|---|---|
| vfprintf | <stdio.h> and <stdarg.h> | <varargs.h>* | ANSI, Win 95 |
| vfwprintf | <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