Friday, April 17, 2009

FTELL

#include
void main()
{
FILE *fp;
char ch;
clrscr();
fp=fopen("s1.txt","r");
fseek(fp,2,SEEK_SET);
ch=fgetc(fp);
while(!feof(fp))
{
printf("%c\t",ch);
printf("%d \n ",ftell(fp));
ch=fgetc(fp);
}
fclose(fp);
}

No comments: