24 lines
438 B
C
24 lines
438 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
/*rewind(<fichier>) : réinitialise la position du curseur
|
|
*/
|
|
int main(void){
|
|
FILE *fic = fopen("text.txt", "r");
|
|
int position_cur = -1;
|
|
if(fic==NULL)
|
|
{exit(1);}
|
|
|
|
printf("Position : %d\n", ftell(fic));
|
|
|
|
fseek(fic,5,SEEK_SET);
|
|
|
|
printf("Position : %d\n", ftell(fic));
|
|
|
|
rewind(fic);
|
|
|
|
printf("Position : %d\n", ftell(fic));
|
|
|
|
fclose(fic);
|
|
|
|
} |