07/06/26 17:34:42
>>291
ほれ。
制約の意味がわからんのだが、ファイル名の最大長とか1行の最大長とかはなんかの縛りなのか?
#include <stdio.h>
#ifndef EOF
#define EOF -1
#endif
int main(int argc, char **argv){
char c;
FILE *fp1 = NULL, *fp2 = NULL;
if( (fp1 = fopen(argv[1], "ab")) == NULL ||
(fp2 = fopen(argv[2], "rb")) == NULL)
return -1;
fseek(fp1, 0, SEEK_END);
while((c = fgetc(fp2)) != EOF){
fputc(c, fp1);
}
fclose(fp1);
fclose(fp2);
return 0;
}