Navigating through a file lines - C
<p>Is there any way to navigate through a file with the option of moving up and down the line number instead of sequentially?</p>

<p>As of now, my code uses fgets to get the last line of ascii characters within the file, but through my research, I haven't found a smarter way of iterating through the file.</p>

<p>For example: </p>

<pre><code>file.txt contains:

"hello\n"
"what's up?\n"
"bye"
</code></pre>

<p>I need to be able to return "bye" at first, but then using key presses, print "what's up\n", and go back down to "bye" through another key press.</p>