RAD Studio
ContentsIndex
PreviousUpNext
stdio.h

The following functions, macros, and classes are provided in stdio.h:

Name 
Description 
Header File
stdio.h
Description
Default buffer size used by setbuf function. 
Header File
stdio.h
Description
File status flags of streams  
Header File
stdio.h
Description
Number of files that can be open simultaneously.  
Header File
stdio.h
Description
The length of a device id string. 
Header File
stdio.h
Description
Size of an array large enough to hold a temporary file name string. 
Header File
stdio.h
Description
Maximum number of unique file names. 
Header File
stdio.h
Description
Constants for defining buffering style to be used with a file.  
Header File
stdio.h, share.h
Category
Input/output Routines
Prototype
FILE *_fsopen(const char *filename, const char *mode, int shflag);
FILE *_wfsopen(const wchar_t *filename, const wchar_t *mode, int shflag);
Description
Opens a stream with file sharing.
_fsopen opens the file named by filename and associates a stream with it. _fsopen returns a pointer that is used to identify the stream in subsequent operations.
The mode string used in calls to _fsopen is one of the following values:  
Header File
stdio.h
Category
Input/output Routines, Process Control Routines
Prototype
int _pclose(FILE * stream);
Description
Waits for piped command to complete.
_pclose closes a pipe stream created by a previous call to _popen, and then waits for the associated child command to complete.
Return Value
On success, _pclose returns the termination status of the child command. This is the same value as the termination status returned by cwait, except that the high and low order bytes of the low word are swapped.
On error, it returns -1.
Portability  
Header File
stdio.h
Category
Input/output Routines
Prototype
FILE *_popen (const char *command, const char *mode);
FILE *_wpopen (const wchar_t *command, const wchar_t *mode);
Description
Creates a command processor pipe.
The _popen function creates a pipe to the command processor. The command processor is executed asynchronously, and is passed the command line in command. The mode string specifies whether the pipe is connected to the command processor’s standard input or output, and whether the pipe is to be opened in binary or text mode.
The mode string can take one of the following values:  
Header File
stdio.h
Category
Memory and String Manipulation Routines
Syntax
int _snprintf(char* buffer, size_t nsize, const char* format, ...);
int _snwprintf(wchar_t* buffer, size_t nsize, const wchar_t* format, ...);
Description
Sends formatted output to a string of a maximum length specified by nsize. _snprintf and _snwprintf are Microsoft compatible with the _snprintf and _snprintfw functions, respectively.
If the number of bytes to output is:
  • < nsize, then all of the characters have been written, including the terminating ‘\0’ character.
  • == nsize, then nsize characters are written with no terminating ‘\0’ character.
If nsize is 0, then the string will not be... more 
Header File
stdio.h
Category
Memory and String Manipulation Routines
Prototype
int _vsnprintf(char* buffer, size_t nsize, const char* format, va_list param);
int _vsnwprintf(wchar_t* buffer, size_t nsize, const wchar_t* format, va_list param);
Description
Sends formatted output to a string of a maximum length specified by nsize. _vsnprintf and _vsnwprintf are Microsoft compatible with the _vsnprintf and _vsnprintfw functions, respectively.
If the number of bytes to output is:
  • < nsize, then all of the characters have been written, including the terminating ‘\0’ character.
  • == nsize, then nsize characters are written with no terminating ‘\0’ character.
If nsize is 0, then the string will... more 
Header File
stdio.h
Category
Input/output Routines
Prototype
void clearerr(FILE *stream);
Description
Resets error indication.
clearerr resets the named stream's error and end-of-file indicators to 0. Once the error indicator is set, stream operations continue to return error status until a call is made to clearerr or rewind. The end-of-file indicator is reset with each input operation.
Return Value
None.
Example  
Header File
stdio.h
Description
A constant indicating that end-of-file has been reached on a file. 
Header File
stdio.h
Category
Input/output Routines
Prototype
int fclose(FILE *stream);
Description
Closes a stream.
fclose closes the named stream. All buffers associated with the stream are flushed before closing. System-allocated buffers are freed upon closing. Buffers assigned with setbuf or setvbuf are not automatically freed. (But if setvbuf is passed null for the buffer pointer it will free it upon close.)
Return Value
fclose returns 0 on success. It returns EOF if any errors were detected.
Portability  
Header File
stdio.h
Category
Input/output Routines
Prototype
int _fcloseall(void);
Description
Closes open streams.
_fcloseall closes all open streams except
stdauxstdstreams
When _fcloseall flushes the associated buffers before closing a stream. The buffers allocated by the system are released.
Note: stdprn and stdaux streams are not available in Win32.
Return Value
_fcloseall returns the total number of streams it closed. The _fcloseall function returns EOF if any errors were detected.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
FILE *_fdopen(int handle, char *type);
FILE *_wfdopen(int handle, wchar_t *type);
Description
Associates a stream with a file handle.
_fdopen associates a stream with a file handle obtained from creat, dup, dup2, or open.
The type of stream must match the mode of the open handle.
The type string used in a call to _fdopen is one of the following values:  
feof 
Header File
stdio.h
Category
Input/output Routines
Prototype
int feof(FILE *stream);
Description
Detects end-of-file on a stream.
feof is a macro that tests the given stream for an end-of-file indicator. Once the indicator is set read operations on the file return the indicator until rewind is called or the file is closed. The end-of-file indicator is reset with each input operation.
Return Value
feof returns nonzero if an end-of-file indicator was detected on the last input operation on the named stream and 0 if end-of-file has not been reached.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
int ferror(FILE *stream);
Description
Detects errors on stream.
ferror is a macro that tests the given stream for a read or write error. If the stream's error indicator has been set it remains set until clearerr or rewind is called or until the stream is closed.
Return Value
ferror returns nonzero if an error was detected on the named stream.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
int fflush(FILE *stream);
Description
Flushes a stream.
If the given stream has buffered output fflush writes the output for stream to the associated file.
The stream remains open after fflush has executed. fflush has no effect on an unbuffered stream.
Return Value
fflush returns 0 on success. It returns EOF if any errors were detected.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
int fgetc(FILE *stream);
wint_t fgetwc(FILE *stream);
Description
Gets character from stream.
fgetc returns the next character on the named input stream.
Return Value
On success fgetc returns the character read after converting it to an int without sign extension. On end-of-file or error it returns EOF.
Example  
Header File
stdio.h
Category
Console I/O Routines
Prototype
int _fgetchar(void);
wint_t _fgetwchar(void);
Description
Reads a character from stdin.
_fgetchar returns the next character from stdin. It is defined as fgetc(stdin).
Note: For Win32 GUI applications, stdin must be redirected.
Return Value
On success _fgetchar returns the character read after converting it to an int without sign extension. On end-of-file or error it returns EOF.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
int fgetpos(FILE *stream, fpos_t *pos);
Description
Gets the current file pointer.
fgetpos stores the position of the file pointer associated with the given stream in the location pointed to by pos. The exact value is unimportant; its value is opaque except as a parameter to subsequent fsetpos calls.
Return Value
On success fgetpos returns 0. On failure it returns a nonzero value and sets the global variable errno to  
Header File
stdio.h
Category
Input/output Routines
Prototype
char *fgets(char *s, int n, FILE *stream);
wchar_t *fgetws(wchar_t *s, int n, FILE *stream); // Unicode version
Description
Gets a string from a stream.
fgets reads characters from stream into the string s. The function stops reading when it reads either n - 1 characters or a newline character whichever comes first. fgets retains the newline character at the end of s. A null byte is appended to s to mark the end of the string.
Return Value
On success fgets returns the string pointed to by s; it returns NULL on end-of-file... more 
Header File
stdio.h
Category
Input/output Routines
Prototype
int _fileno(FILE *stream);
Description
Gets the file handle.
_fileno is a macro that returns the file handle for the given stream. If stream has more than one handle _fileno returns the handle assigned to the stream when it was first opened.
Return Value
_fileno returns the integer file handle associated with stream.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
int _flushall(void);
Description
Flushes all streams.
_flushall clears all buffers associated with open input streams and writes all buffers associated with open output streams to their respective files. Any read operation following _flushall reads new data into the buffers from the input files. Streams stay open after _flushall executes.
Return Value
_flushall returns an integer the number of open input and output streams.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
FILE *fopen(const char *filename, const char *mode);
FILE *_wfopen(const wchar_t *filename, const wchar_t *mode);
Description
Opens a stream.
fopen opens the file named by filename and associates a stream with it. fopen returns a pointer to be used to identify the stream in subsequent operations.
The mode string used in calls to fopen is one of the following values:  
Header File
stdio.h
Category
Input/output Routines
Prototype
int fprintf(FILE *stream, const char *format[, argument, ...]);
int fwprintf(FILE *stream, const wchar_t *format[, argument, ...]);
Description
Writes formatted output to a stream.
fprintf accepts a series of arguments applies to each a format specifier contained in the format string pointed to by format and outputs the formatted data to a stream. There must be the same number of format specifiers as arguments.
Note: For details on format specifiers, see printf Format Specifiers.
Return Value
fprintf returns the number of bytes output. In the event of error it returns EOF.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
int fputc(int c, FILE *stream);
wint_t fputwc(wint_t c, FILE *stream);
Description
Puts a character on a stream.
fputc outputs character c to the named stream.
Note: For Win32 GUI applications, stdin must be redirected.
Return Value
On success, fputc returns the character c. On error, it returns EOF.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
int _fputchar(int c);
wint_t _fputwchar(wint_t c);
Description
Outputs a character to stdout.
_fputchar outputs character c to stdout. _fputchar(c) is the same as fputc(cstdout).
Note: For Win32 GUI applications, stdout must be redirected.
Return Value
On success _fputchar returns the character c.
On error it returns EOF.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
int fputs(const char *s, FILE *stream);
int fputws(const wchar_t *s, FILE *stream);
Description
Outputs a string on a stream.
fputs copies the null-terminated string s to the given output stream; it does not append a newline character and the terminating null character is not copied.
Return Value
On success fputs returns a non-negative value.
On error it returns a value of EOF.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
size_t fread(void *ptr, size_t size, size_t n, FILE *stream);
Description
Reads data from a stream.
fread reads n items of data each of length size bytes from the given input stream into a block pointed to by ptr.
The total number of bytes read is (n * size).
Return Value
On success fread returns the number of items (not bytes) actually read.
On end-of-file or error it returns a short count (possibly 0).
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
FILE *freopen(const char *filename, const char *mode, FILE *stream);
FILE *_wfreopen(const wchar_t *filename, const wchar_t *mode, FILE *stream);
Description
Associates a new file with an open stream.
freopen substitutes the named file in place of the open stream. It closes stream regardless of whether the open succeeds. freopen is useful for changing the file attached to stdin, stdout, or stderr.
The mode string used in calls to fopen is one of the following values:  
Header File
stdio.h
Category
Input/output Routines
Prototype
int fscanf(FILE *stream, const char *format[, address, ...]);
int fwscanf(FILE *stream, const wchar_t *format[, address, ...]);
Description
Scans and formats input from a stream.
fscanf scans a series of input fields one character at a time reading from a stream. Then each field is formatted according to a format specifier passed to fscanf in the format string pointed to by format. Finally fscanf stores the formatted input at an address passed to it as an argument following format. The number of format specifiers and addresses must be the same as the number of... more 
Header File
stdio.h
Category
Input/output Routines
Prototype
int fseek(FILE *stream, long offset, int whence);
Description
Repositions a file pointer on a stream.
fseek sets the file pointer associated with stream to a new position that is offset bytes from the file location given by whence. For text mode streams offset should be 0 or a value returned by ftell.
whence must be one of the values 0. 1, or 2 which represent three symbolic constants (defined in stdio.h) as follows:
fseek discards any character pushed back using ungetc. fseek is used with stream I/O; for file handle I/O use lseek.... more 
Header File
stdio.h
Category
Input/output Routines
Prototype
int fsetpos(FILE *stream, const fpos_t *pos);
Description
Positions the file pointer of a stream.
fsetpos sets the file pointer associated with stream to a new position. The new position is the value obtained by a previous call to fgetpos on that stream. It also clears the end-of-file indicator on the file that stream points to and undoes any effects of ungetc on that file. After a call to fsetpos the next operation on the file can be input or output.
Return Value
On success fsetpos returns 0.
On failure it returns a nonzero... more 
Header File
stdio.h
Category
Input/output Routines
Prototype
long int ftell(FILE *stream);
Description
Returns the current file pointer.
ftell returns the current file pointer for stream. The offset is measured in bytes from the beginning of the file (if the file is binary). The value returned by ftell can be used in a subsequent call to fseek.
Return Value
ftell returns the current file pointer position on success. It returns -1L on error and sets the global variable errno to a positive value.
In the event of an error return the global variable errno is set to one of the following... more 
Header File
stdio.h
Category
Input/output Routines
Prototype
size_t fwrite(const void *ptr, size_t size, size_t n, FILE *stream);
Description
Writes to a stream.
fwrite appends n items of data each of length size bytes to the given output file. The data written begins at ptr. The total number of bytes written is (n x size). ptr in the declarations is a pointer to any object.
Return Value
On successful completion fwrite returns the number of items (not bytes) actually written.
On error it returns a short count.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
int getc(FILE *stream);
wint_t getwc(FILE *stream);
Description
Gets character from stream.
getc returns the next character on the given input stream and increments the stream's file pointer to point to the next character.
Note: For Win32 GUI applications, stdin must be redirected.
Return Value
On success, getc returns the character read, after converting it to an int without sign extension.
On end-of-file or error, it returns EOF.
Example  
Header File
stdio.h
Category
Console I/O Routines
Prototype
int getchar(void);
wint_t getwchar(void);
Description
Gets character from stdin.
getchar is a macro that returns the next character on the named input stream stdin. It is defined to be getc(stdin).
Note: Do not use this function in Win32 GUI applications.
Return Value
On success, getchar returns the character read, after converting it to an int without sign extension.
On end-of-file or error, it returns EOF.
Example  
Header File
stdio.h
Category
Console I/O Routines
Prototype
char *gets(char *s);
wchar_t *_getws(wchar_t *s); // Unicode version
Description
Gets a string from stdin.
gets collects a string of characters terminated by a new line from the standard input stream stdin and puts it into s. The new line is replaced by a null character (\0) in s.
gets allows input strings to contain certain whitespace characters (spaces, tabs). gets returns when it encounters a new line; everything up to the new line is copied into s.
The gets function is not length-terminated. If the input string is sufficiently large, data... more 
Header File
stdio.h
Category
Input/output Routines
Prototype
int _getw(FILE *stream);
Description
Gets an integer from stream.
_getw returns the next integer in the named input stream. It assumes no special alignment in the file.
_getw should not be used when the stream is opened in text mode.
Return Value
_getw returns the next integer on the input stream.
On end-of-file or error, _getw returns EOF.
Note: Because EOF is a legitimate value for _getw to return, feof or ferror should be used to detect end-of-file or error.
Example  
Header File
stdio.h
Category
Console I/O Routines
Prototype
int printf(const char *format[, argument, ...]);
int wprintf(const wchar_t *format[, argument, ...]);
Description
Writes formatted output to stdout.
The printf function:
  • Accepts a series of arguments
  • Applies to each argument a format specifier contained in the format string *format
  • Outputs the formatted data (to the screen, a stream, stdout, or a string)
There must be enough arguments for the format. If there are not, the results will be unpredictable and likely disastrous. Excess arguments (more than required by the format) are merely ignored.
Note: For Win32 GUI applications, stdout must be redirected.... more 
Header File
stdio.h
Category
Input/output Routines
Prototype
int putc(int c, FILE *stream);
wint_t putwc(wint_t c, FILE *stream);
Description
Outputs a character to a stream.
putc is a macro that outputs the character c to the stream given by stream.
Return Value
On success, putc returns the character printed, c.
On error, putc returns EOF.
Example  
Header File
stdio.h
Category
Console I/O Routines
Prototype
int putchar(int c);
wint_t putwchar(wint_t c);
Description
putchar is a macro defined to be putc(c, stdout).
Note: For Win32 GUI applications, stdout must be redirected.
Return Value
On success, putchar returns the character c. On error, putchar returns EOF.
Example  
Header File
stdio.h
Category
Console I/O Routines
Prototype
int puts(const char *s);
int _putws(const wchar_t *s);
Description
Outputs a string to stdout.
puts copies the null-terminated string s to the standard output stream stdout and appends a newline character.
Note: For Win32 GUI applications, stdout must be redirected.
Return Value
On successful completion, puts returns a nonnegative value. Otherwise, it returns a value of EOF.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
int _putw(int w, FILE *stream);
Description
Writes an integer on a stream.
_putw outputs the integer w to the given stream. _putw neither expects nor causes special alignment in the file.
Return Value
On success, _putw returns the integer w. On error, _putw returns EOF. Because EOF is a legitimate integer, use ferror to detect errors with _putw.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
int remove(const char *filename);
int _wremove(const wchar_t *filename);
Description
Removes a file.
remove deletes the file specified by filename. It is a macro that simply translates its call to a call to unlink. If your file is open, be sure to close it before removing it.
The filename string can include a full path.
Return Value
On successful completion, remove returns 0. On error, it returns -1, and the global variable errno is set to one of the following values:  
Header File
stdio.h
Category
Input/output Routines
Prototype
int rename(const char *oldname, const char *newname);
int _wrename(const wchar_t *oldname, const wchar_t *newname);
Description
Renames a file.
rename changes the name of a file from oldname to newname. If a drive specifier is given in newname, the specifier must be the same as that given in oldname.
Directories in oldname and newname need not be the same, so rename can be used to move a file from one directory to another. Wildcards are not allowed.
This function will fail (EEXIST) if either file is currently open in any process.
Return Value
On... more 
Header File
stdio.h
Category
Input/output Routines
Prototype
void rewind(FILE *stream);
Description
Repositions a file pointer to the beginning of a stream.
rewind(stream) is equivalent to fseek(stream, 0L, SEEK_SET), except that rewind clears the end-of-file and error indicators, while fseek clears the end-of-file indicator only.
After rewind, the next operation on an update file can be either input or output.
Return Value
None.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
int _rmtmp(void);
Description
Removes temporary files.
The _rmtmp function closes and deletes all open temporary file streams which were previously created with tmpfile. The current directory must the same as when the files were created, or the files will not be deleted.
Return Value
_rmtmp returns the total number of temporary files it closed and deleted.
Example  
Header File
stdio.h
Category
Console I/O Routines
Prototype
int scanf(const char *format[, address, ...]);
int wscanf(const wchar_t *format[, address, ...]);
Description
Scans and formats input from the stdin stream.
Note: For Win32 GUI applications, stdin must be redirected.
The scanf function:
  • scans a series of input fields one character at a time
  • formats each field according to a corresponding format specifier passed in the format string *format.
  • vsscanf scans and formats input from a string, using an argument list
There must be one format specifier and address for each input field.
scanf might stop scanning a particular field before it... more 
Header File
stdio.h
Category
Input/output Routines
Prototype
void setbuf(FILE *stream, char *buf);
Description
Assigns buffering to a stream.
setbuf causes the buffer buf to be used for I/O buffering instead of an automatically allocated buffer. It is used after stream has been opened.
If buf is null, I/O will be unbuffered; otherwise, it will be fully buffered. The buffer must be BUFSIZ bytes long (specified in stdio.h).
stdin and stdout are unbuffered if they are not redirected; otherwise, they are fully buffered. setbuf can be used to change the buffering style used.
Unbuffered means that characters written to a stream... more 
Header File
stdio.h
Category
Input/output Routines
Prototype
int setvbuf(FILE *stream, char *buf, int type, size_t size);
Description
Assigns buffering to a stream.
setvbuf causes the buffer buf to be used for I/O buffering instead of an automatically allocated buffer. It is used after the given stream is opened.
If buf is null, a buffer will be allocated using malloc; the buffer will use size as the amount allocated. The buffer will be automatically freed on close. The size parameter specifies the buffer size and must be greater than zero.
The parameter size is limited by the constant UINT_MAX as defined... more 
Header File
stdio.h
Category
Memory and String Manipulation Routines
Prototype
int snprintf(char* buffer, size_t nsize, const char* fmt, ...);
int snwprintf(wchar_t* buffer, size_t nsize, const wchar_t* fmt, ...);
Description
Sends formatted output to a buffer of a maximum length specified by nsize.
If the number of bytes to output is:
  • < nsize, then all of the characters have been written, including the terminating ‘\0’ character.
  • == nsize, then nsize characters are written, with no terminating ‘\0’ character.
> nsize, then only nsize characters are written, with no terminating ‘\0’ character.
If nsize is 0, then the string will not be... more 
Header File
stdio.h
Category
Memory and String Manipulation Routines
Prototype
int sprintf(char *buffer, const char *format[, argument, ...]);
int swprintf(wchar_t *buffer, const wchar_t *format[, argument, ...]);
Description
Writes formatted output to a string.
Note: For details on format specifiers, see printf.
sprintf accepts a series of arguments, applies to each a format specifier contained in the format string pointed to by format, and outputs the formatted data to a string.
sprintf applies the first format specifier to the first argument, the second to the second, and so on. There must be the same number of format specifiers as arguments.
Return... more 
Header File
stdio.h
Category
Memory and String Manipulation Routines
Syntax
int sscanf(const char *buffer, const char *format[, address, ...]);
int swscanf(const wchar_t *buffer, const wchar_t *format[, address, ...]);
Description
Scans and formats input from a string.
Note: For details on format specifiers, see scanf.
sscanf scans a series of input fields, one character at a time, reading from a string. Then each field is formatted according to a format specifier passed to sscanf in the format string pointed to by format. Finally, sscanf stores the formatted input at an address passed to it as an argument following format. There must... more 
Header File
stdio.h
Description
Predefined streams automatically opened when the program is started.  
Header File
stdio.h
Category
Input/output Routines
Prototype
char *_tempnam(char *dir, char *prefix)
wchar_t *_wtempnam(wchar_t *dir, wchar_t *prefix)
Description
Creates a unique file name in specified directory.
The _tempnam function accepts single-byte or multibyte string arguments.
The _tempnam function creates a unique file name in arbitrary directories. The unique file is not actually created; _tempnam only verifies that it does not currently exist. It attempts to use the following directories, in the order shown, when creating the file name:
  • The directory specified by the TMP environment variable.
  • The dir argument to _tempnam.
  • The P_tmpdir definition in stdio.h. If you edit stdio.h... more 
Header File
stdio.h
Category
Input/output Routines
Prototype
FILE *tmpfile(void);
Description
Opens a “scratch” file in binary mode.
tmpfile creates a temporary binary file and opens it for update (w + b). If you do not change the directory after creating the temporary file, the file is automatically removed when it’s closed or when your program terminates.
Return Value
tmpfile returns a pointer to the stream of the temporary file created. If the file can’t be created, tmpfile returns NULL.
Example  
Header File
stdio.h
Category
Input/output Routines
Prototype
char *tmpnam(char *s);
wchar_t *_wtmpnam(wchar_t *s);
Description
Creates a unique file name.
tmpnam creates a unique file name, which can safely be used as the name of a temporary file. tmpnam generates a different string each time you call it, up to TMP_MAX times. TMP_MAX is defined in stdio.h as 65,535.
The parameter to tmpnam, s, is either null or a pointer to an array of at least L_tmpnam characters. L_tmpnam is defined in stdio.h. If s is NULL, tmpnam leaves the generated temporary file name in an internal static object and returns... more 
Header File
stdio.h
Category
Input/output Routines
Prototype
int ungetc(int c, FILE *stream);
wint_t ungetwc(wint_t c, FILE *stream);
Description
Pushes a character back into input stream.
Note: Do not use this function in Win32 GUI applications.
ungetc pushes the character c back onto the named input stream, which must be open for reading. This character will be returned on the next call to getc or fread for that stream. One character can be pushed back in all situations. A second call to ungetc without a call to getc will force the previous character to be forgotten. A call to fflush, fseek,... more 
Header File
stdio.h
Category
Input/output Routines
Prototype
int vfprintf(FILE *stream, const char *format, va_list arglist);
int vfwprintf(FILE *stream, const wchar_t *format, va_list arglist);
Description
Writes formatted output to a stream.
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.
For details on format specifiers, see Printf Format Specifiers.
vfprintf accepts a pointer to a series of arguments, applies to each argument a format specifier contained in the format string pointed to by format, and... more 
Header File
stdio.h
Category
Input/output Routines
Prototype
int vfscanf(FILE *stream, const char *format,va_list arglist);
Description
Scans and formats input from a stream.
The v...scanf functions are known as alternate entry points for the ...scanf functions. They behave exactly like their ...scanf counterparts but they accept a pointer to a list of arguments instead of an argument list.
For details on format specifiers, see Scanf Format Specifiers.
vfscanf scans a series of input fields one character at a time reading from a stream. Then each field is formatted according to a format specifier passed to vfscanf in the format string pointed... more 
Header File
stdio.h
Category
Console I/O Routines
Prototype
int vprintf(const char *format, va_list arglist);
int vwprintf(const wchar_t * format, va_list arglist);
Description
Writes formatted output to stdout.
Note: Do not use this function in Win32 GUI applications.
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.
Note: For details on format specifiers, see Printf Format Specifiers.
vprintf accepts a pointer to a series of arguments, applies to each a format specifier contained in the... more 
Header File
stdio.h
Category
Console I/O Routines
Prototype
int vscanf(const char *format, va_list arglist);
Description
Scans and formats input from stdin.
Note: Do not use this function in Win32 GUI applications.
The v...scanf functions are known as alternate entry points for the ...scanf functions. They behave exactly like their ...scanf counterparts, but they accept a pointer to a list of arguments instead of an argument list.
Note: For details on format specifiers, see Scanf Format Specifiers.
vscanf scans a series of input fields, one character at a time, reading from stdin. Then each field is formatted according to a format... more 
Header File
stdio.h
Category
Memory and String Manipulation Routines
Prototype
int vsnprintf(char* buffer, size_t nsize, const char* format, va_list param);
int vsnwprintf(wchar_t* buffer, size_t nsize, const wchar_t* format, va_list param);
Description
Sends formatted output to a buffer of maximum length specified by nsize.
If the number of bytes to output is:
  • < nsize, then all of the characters have been written, including the terminating ‘\0’ character.
  • == nsize, then nsize characters are written, with no terminating ‘\0’ character.
> nsize, then only nsize characters are written, with no terminating ‘\0’ character.
If nsize is 0, then the string will not... more 
Header File
stdio.h
Category
Memory and String Manipulation Routines
Prototype
int vsprintf(char *buffer, const char *format, va_list arglist);
int vswprintf(wchar_t *buffer, const wchar_t *format, va_list arglist);
Description
Writes formatted output to a string.
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.
vsprintf accepts a pointer to a series of arguments, applies to each a format specifier contained in the format string pointed to by format, and outputs the formatted data to a string.... more 
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!