I currently have a file that appends new entries to the current file. I would like to fetch the 5 most recent entries. How can I read the last line first in C? I would like to use the fgets command to read in line by line if that's possible.
Thank you for your help!
Edit: For instance:
Original File:
The cat is fast.
Dogs are cool.
I like pie.
Desired Output:
I like pie.
Dogs are cool.
The cat is fast.