我无法让这个 fseek() 函数在我的代码中工作。我写的文字只是没有从我指出的地方开始,我不知道为什么。它应该从 \n 开始写入,它只是覆盖所有文本文件。即使我用它打开它a
也不会去我通过参数命令的地方。
fclose(file);
FILE *file_a = fopen("ex6.txt", "w");
fseek(file_a, -1, SEEK_END);
puts("Write text to add:");
while((letter = getchar()) != '\n')
{
fputc(letter, file_a);
};
怎么了?为什么这不起作用?