/* Read files fron the SCI Specification Revision: 1-SEPT-1994 by Daniel Edmunds */ #include /* I/O definitions */ #define IN_FILE "SCICode.C" #define OUT_FILE "SCICode.Txt_Test" main () { char thischar; char line[135]; int index; FILE *fpin, *fopen(); FILE *fpout, *fopen(); fpin = fopen(IN_FILE, "r"); fpout = fopen(OUT_FILE, "w"); for (index = 0; index <= 132; ++index) { line[index] = 0; } index = 0; thischar = getc(fpin); while (thischar != EOF) { if (thischar == 13) { line[index] = 10; fputs(line, fpout); for (index = 0; index <= 132; ++index) { line[index] = 0; } index = 0; thischar = getc(fpin); } else { line[index] = thischar; ++index; thischar = getc(fpin); } } fclose(fpin); fclose(fpout); }