b***y 发帖数: 2799 | 1 ☆─────────────────────────────────────☆
baodong (馋懒大魔包) 于 (Fri Sep 23 13:28:48 2005) 提到:
Hello, I do not understand why the following code only wrote the test.txt once
. If I comment out "if (!fpTest)", it works. Why is it different with "if (!
fpTest)"???
#include
int main(void)
{
FILE* fpTest = NULL;
for (int i=0; i<5; i++)
{
if (!fpTest)
fpTest =fopen("test.txt", "w");
fprintf(fpTest, "%d\n", i);
fflush(fpTest);
fclose(fpT |
|