Hi,
I am trying to copy several rtf files into one rtf file. this is basically what i have done
Code:
char in_filename[MAXPATHLEN];
char out_filename[MAXPATHLEN];
FILE *in_fp, *out_fp;
char line_buffer[80];
//....get the required file name through user input
// assumed they lead to correct files so the program does not
// crash on incorrect file path
if (out_fp = fopen(out_filename, "w") == '\0')
{
printf("error opening file");
break;
}
in_fp = fopen(in_filename, "r");
while (fgets(line_buffer, 80, in_fp) != NULL)
fputs(line_buffer, out_fp);
fclose(in_fp);
fclose(out_fp);
but i get a segmentation fault after reading the first line of the file