怎么样把变量写入文本啊
怎么样把变量写入文本啊#include <stdio.h>
main()
{
FILE *funny;
FILE *ok;
char c;
int i;
i=0;
funny = fopen("1.TXT","r");
ok = fopen(''2.TXT","w");
if(funny == NULL)
printf("File doesn't exist\n");
else
{
while (c!= EOF)
{ i=i+1;
c = fgetc(funny);
if (c==97)
putchar(i,ok);
fputs(":1000 ",ok);
}
}
fclose(ok);
fclose(funny);
}
为什么变量i写不进去,各位大侠救救小妹