c语言读记事本问题
怎么实现清除记事本里的数据再重新往记事本里写数据?求解答,谢谢
FILE *fp;
if((fp=fopen("data.txt","r+"))==NULL)
{
printf("can't open the file!");
exit(0);
}
fscanf(fp,"%d",&i);
printf("The data is:");
printf("%d\n",i);
i++;
fprintf(fp,"%d",i);
怎么实现每次从记事本里读出来的数据都加1?还请高手多多指点,谢谢