/* Function attach: * * Attaches the ascii file pointed to by f2 to the file pointed to by f1. * * Warning: maximum length of the ascii file lines is MAX_CHAR characters * */ #include #define MAX_CHAR 1024 void attach (FILE *f1, FILE *f2) { char string[MAX_CHAR]; fputc('\n',f1); for(;;) { fgets(string,MAX_CHAR,f2); if (feof(f2)) break; fputs(string,f1); } return; }