void Cat(FILE *input_file, FILE *output_file)
{
char ch;
while( ( ch = fgetc(input_file) ) != EOF )
fputc(ch,output_file);
}
int main ()
{
FILE *input_file, *output_file;
...
output_file = fopen(<filename 3>, "a+"); // Target file
input_file = fopen(<filename 1>, "r");
Cat(input_file, output_file);
fclose(input_file);
input_file = fopen(<filename 2>, "r");
Cat(input_file, output_file);
fclose(input_file);
fclose(output_file);
}