int fseek ( FILE * stream, long int offset, int origin )
fseek()的使用:
#include<stdio.h>
//text.txt存放abcdef
int main()
{
FILE* pf = fopen("text.txt", "r");
if (pf==NULL)
{
return 0;
}
fseek(pf, 2, SEEK_CUR);
char ch = fgetc(pf);
printf("%c\n", ch);//打印c
fclose(pf);
pf = NULL;
return 0;
}