Reset fgets to read from the beginning of a file?
Well, I need to read a file (containing only float values) to check how many lines it contains - easy, using fgets. Then I need to malloc a float array to hold the values, also easy. And here is where I'm stuck: I need to read the file again to obtain the values and fill the array.
However, subsequent calls to fgets after the complete file has been read, return NULL - which I kinda understand why. Is there any way to 'reset' fgets to read from the start again; without closing the file and re-opening it?