/* program to understand the use of rewind() */
main()
{
*fptr;
fptr=fopen("stu","rb+");
(fptr==NULL)
{
printf("Error when open file \n" );
(1);
}
printf("position indicator--%ld\n", ftell(fptr));
fseek(fptr,0,3);
printf("position indicator--%ld \n", ftell(fptr));
rewind(fptr);
printf("position indicator-- %ld \n", ftell(fptr));
fclose(fptr);
0;
}
|