home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.tar / ftp.whtech.com / Geneve / 9640news / CAT36 / EMULSRC.ZIP / HEADER.C < prev    next >
Text File  |  1993-04-15  |  717b  |  38 lines

  1. #include <stdio.h>
  2.  
  3. convert(char[],char[]);
  4.  
  5. main()
  6. {
  7.     convert("b:system1","system1.bin");
  8.     convert("b:system2","system2.bin");
  9.     convert("b:system3","system3.bin");
  10.     convert("b:system4","system4.bin");
  11.     convert("b:system5","system5.bin");
  12. }
  13.  
  14. convert(char inname[],char outname[])
  15. {
  16.     FILE *infile,*outfile;
  17.     int i,c;
  18.  
  19.     printf("\nPress any key to convert %s -> %s ",inname,outname);
  20.     while(!kbhit()); getch();
  21.     printf("\nWorking...\n");
  22.  
  23.     infile=fopen(inname,"rb");
  24.     outfile=fopen(outname,"wb");
  25.  
  26.     for(i=0;i<13;i++) fgetc(infile);
  27.  
  28.     i=0;
  29.     while(!feof(infile))
  30.     {
  31.         c=fgetc(infile);
  32.         if (i++<10) printf("%02x %c\n",c,c);
  33.         fputc(c,outfile);
  34.     }
  35.  
  36.     fclose(infile);
  37.     fclose(outfile);
  38. }