#include <stdio.h>
int main(void)
{
char s[64] = "";
FILE *fp = fopen("d:\\data.txt", "r+");
if (fp == NULL)
perror ("Error open file");
else
{
fputs("codeing is fun", fp);
fflush(fp);
rewind(fp);
fgets(s, 63, fp);
puts(s);
fclose(fp);
}
return 0;
}
/*
run:
codeing is fun
*/