Reading a file again
Hi, how can I start back from the beginning of a file after I have already read through it to read it again? Right now I have read through each line and closed it and re-opened it with a different pointer name.I need to read from it a 3rd time and another 3rd name for the file would be ridiculous,
// Read the stuff in
You are talking about a "pointer name" so I think you are talking about opening the file with th c-function fopen().
You dont even have to close the file before reading it again. just use
FILE * f = fopen(...);
// read the complete file
fclear(f); // reset eof
// read again
When the file is closed and the opened again won't it start reading it from the beginning?
Yes it will start reading from the beginning.