函数名:fseek
功 能:重定位流上的文件指针
用 法:int fseek(FILE *fp, long offset, int fromwhere)
程序用例:
#include <stdio.h>
#define bool int
#define BOOL int
#define true 1
#define TRUE 1
#define false 0
#define FALSE 0
#define NUL -1
#define BUFFER_MAX 10
typedef struct
{
char ch[BUFFER_MAX];
int num;
}CharBuffer;
long readLocal = 0;
CharBuffer buff;
void fmove(FILE *fp,int num)
{
int i = 0;
char _ch = '/0';
for(i = 0; i < num; i ++){
_ch = getc(fp);
}
}
bool readFile(void)
{
int flag = 0;
FILE *fp;
if((fp=fopen("123.txt","r")) == NULL){
printf("File Open failure/n");
return false;
}
fseek(fp,readLocal,0);
//fmove(fp,readLocal);