FILE* f = fopen("rajat", "w");
fputs("sometext", f);
fseek(f, 6, SEEK_SET);
fputs("is a", f);
fclose(f);
成功返回:“someteis a”
但
FILE* f = fopen("rajat", "a");
fputs("sometext", f);
fseek(f, 6, SEEK_SET);
fputs("is a", f);
fclose(f);
不工作。返回“sometextis a”
任何想法为什么?解决方案是什么,以便第二个代码输出与第一个完全相同?