|
|
|
|
Text only
|
13 lines
|
7 sloc
|
0.296 kB
  1.    
  2. //record = a struct 
  3. //handle = file rb+ 
  4.  
  5.   fseek( handle, sizeof( record ) * ( line ), SEEK_SET ); 
  6.     
  7.   fread( &tmp, 1, sizeof( record ), handle ); 
  8.    
  9.    //Modify tmp here 
  10.    
  11.   fseek( handle, sizeof( record ) * ( line ), SEEK_SET ); 
  12.  
  13.   fwrite( &tmp, sizeof( record ), 1, handle );