.TH FWRITE 3 "April 2010" "NEWLIB" "NEWLIB"
.SH NAME

4.31 `fwrite'--write array elements

.SH SYNOPSIS
     #include <stdio.h>
     size_t fwrite(const void *BUF, size_t SIZE,
         size_t COUNT, FILE *FP);

     #include <stdio.h>
     size_t _fwrite_r(struct _reent *PTR, const void *BUF, size_t SIZE,
         size_t COUNT, FILE *FP);
.SH DESCRIPTION
`fwrite' attempts to copy, starting from the memory location BUF, COUNT
elements (each of size SIZE) into the file or stream identified by FP.
`fwrite' may copy fewer elements than COUNT if an error intervenes.

   `fwrite' also advances the file position indicator (if any) for FP
by the number of _characters_ actually written.

   `_fwrite_r' is simply the reentrant version of `fwrite' that takes
an additional reentrant structure argument: PTR.

.SH RETURNS
If `fwrite' succeeds in writing all the elements you specify, the
result is the same as the argument COUNT.  In any event, the result is
the number of complete elements that `fwrite' copied to the file.

.SH PORTABILITY
ANSI C requires `fwrite'.

   Supporting OS subroutines required: `close', `fstat', `isatty',
`lseek', `read', `sbrk', `write'.

.SH "SEE ALSO"
.B fwrite
is part of the
.B 
library.
The full documentation for
.B 
is maintained as a Texinfo manual.  If 
.B info
and
.B 
are properly installed at your site, the command
.IP
.B info 
.PP
will give you access to the complete manual.
