Leggi il regolamento (bastava una ricerca)
Vedi fgets
Vedi anche qui