c++文件的读写zz

#include <stdio.h>
int main ()
{
 int buffer;
 int i;
 FILE * inFile;
 FILE * outFile;
 inFile  = fopen ("xx.xx","r");
 outFile = fopen ("xx.xx", "w+b");
 
 //1   frame:9504 x 32bit
 //300 frame:9504 x 300 x 32 bit = 2851200 x 32bit
 for (i = 0; i < 2851200; i++)
 {
  fscanf  (inFile,"%x",&buffer);
  fwrite  (&buffer,4,1,outFile);
 }
 fclose (inFile);
 fclose (outFile);
  return 0;
}

你可能感兴趣的:(c++文件的读写zz)