Append to the end of a file in C

前端 未结 2 1561
情深已故
情深已故 2020-12-03 01:00

I\'m trying to append the contents of a file myfile.txt to the end of a second file myfile2.txt in c. I can copy the contents, but I can\'t find a way to append. Here\'s my

2条回答
  •  無奈伤痛
    2020-12-03 01:30

    Open with append:

    pFile2 = fopen("myfile2.txt", "a");
    

    then just write to pFile2, no need to fseek().

提交回复
热议问题