COHERENT manpages

This page displays the COHERENT manpage for fprintf() [Print formatted output into file stream].

List of available manpages
Index


fprintf() -- STDIO Function (libc)

Print formatted output into file stream
#include <stdio.h>
int fprintf(fp, format, [arg1, .... argN])
FILE *fp; char *format;
[data type] arg1, ... argN;

fprintf() formats and prints a string.  It resembles the function printf(),
except that it writes its output  into the stream pointed to by fp, instead
of to the standard output.

fprintf()  uses the  format to  specify an output  format for  arg1 through
argN.

See printf() for a description of fprintf()'s formatting codes.

If it wrote the formatted string correctly, fprintf() returns the number of
characters written.  Otherwise, it returns a negative number.

Example

For an example of this routine, see the entry for fscanf().

See Also

libc,
printf(),
sprintf(),
vfprintf()
ANSI Standard, §7.9.6.1
POSIX Standard, §8.1

Notes

Because C does not perform type  checking, it is essential that an argument
match its  specification.  For example, if  the argument is a  long and the
specification is  for a short,  fprintf() will peel  off the first  word of
that long and present it as an short.