fwrite()                 Write Unformatted Data to Stream
 
 #include   <stdio.h>
 
 int        fwrite(buffer,size,count,stream);
 char       *buffer;                     Pointer to data to be written
 int        size;                        Item size in bytes
 int        count;                       Max number of items to be written
 FILE       *stream;                     Pointer to file structure
 
 
    fwrite() writes up to 'count' items of data, each of length 'size'
    bytes, from 'buffer' to the output 'stream'.  If there is a file
    pointer associated with 'stream', it is incremented by the number of
    bytes actually written.
 
    Returns:    The number of data items actually written.  The number
                may be less than 'count' if an error occurs.
 
      Notes:    If 'stream' was open in text mode, each carriage-return
                is replaced with a carriage-return-line-feed pair.  This
                has no effect on the return value.
 
  -------------------------------- Example ---------------------------------
 
    The following statements open a file for appending and write the
    contents of a buffer.
 
          #include <stdio.h>
 
          FILE *stream;
          char buffr[128];
 
          main()
          {
              if ((stream = fopen("data.bak","a+"))!= NULL) {
                  .
                  .
                  .
                  fwrite(buffr,sizeof(char),128,stream);
               }
           }

Seealso:



This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster