692_____________________________________________ 12


 , 1960 ..

       -
 .          14 
 14.12.

12.9.2.3  

       .  
    ,    -
  ,     ..  , -
   .    ,   -
    .      -
        .

        
-  .        -
  ,   ,   
:      .  ,
 ,    ,   
.           
     ,      -
       -
. ,     1^ 
       -    -
,     ,       .

 ,    ,    
12.9.2.1.          -
  fwrite  fread:

#include <stdio.h>
size t fwrite(const void *ptr, size t size, size_t n, FILE *stream) ;

size_t fread(void *ptr, size_t size, size_t n, FILE *stream);

     ptr     .
 size      ,   n -
   .    
  .

int i = 1, j = 25, il, jl;

double a = 25e6, al;

char s[10], si [10] ;

strcpy(s,"") ;

FILE *F;

//   

if ((F = fopen("Test.dat", "wb")) == NULL)

{

ShowMessage("   ");

return;

}

fwrite(&i,sizeof(int),1,F);           //  i
fwrite(&j,sizeof(int),1,F);           //  j
fwrite(&a,sizeof(double),1,F);        //  
fwrite(s,sizeof(char),strlen(s)+1,F); //   s
fclose(F) ;

//   

if ((F = fopen("Test.dat", "rb")) == NULL)
{
ShowMessage("   ");