Sorry i should have pasted my code so you didn't have to download. here is it in plain view for those who don't want to download.
Code:
#include<stdio.h>
#include<stdlib.h>
#define AFILE argv[1]
#define BFILE argv[2]
void bappend(FILE *from, FILE *to);
int main(int argc, char *argv[]) {
if(argc != 3) {
printf("\nUsage: bappend <file1> <file2>");
exit(1);
}
bappend(AFILE, BFILE);
return 0;
}
void bappend(FILE *from, FILE *to) {
FILE *a, *b;
int ch;
if((a = fopen(from, "rb")) == NULL) {
printf("\nCannot open file.");
exit(1);
}
if((b = fopen(to, "ab")) == NULL) {
printf("\nCannot open file.");
exit(1);
}
for(;;) {
ch = fgetc(a);
if(ch == EOF) break;
fputc(ch, b);
}
fclose(a);
fclose(b);
}