标签:vps stdio.h tar pst xxxx targe 文件 mkt highlight
函数名: rewind
功 能: 将文件指针重新指向一个流的开头
用 法: int rewind(FILE *stream);
程序例:
#include <stdio.h>
#include <dir.h>
int main(void)
{
FILE *fp;
char *fname = "TXXXXXX", *newname, first;
newname = mktemp(fname);
fp = fopen(newname,"w+");
fprintf(fp,"abcdefghijklmnopqrstuvwxyz");
rewind(fp);
fscanf(fp,"%c",&first);
printf("The first character is: %c/n",first);
fclose(fp);
remove(newname);
return 0;
}
标签:vps stdio.h tar pst xxxx targe 文件 mkt highlight
原文地址:http://www.cnblogs.com/Jacket-K/p/7525259.html