C/fseek: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Lethern (dyskusja | edycje)
Lethern (dyskusja | edycje)
Linia 20:
{
FILE *f = fopen("notatki.txt", "r+");
if (f == NULL)
{ return 1;
 
fseek(f, 10, 0); // dziesiąta pozycja, licząc od początku
printf("%c\n", fgetc(f));
printf("%c\n", fgetc(f));
fseek(f, -10, 2); // dziesiąta pozycja od końca
printf("%c\n", fgetc(f));
fclose(f);
}
return 0;
}