I'm not understanding how to discard unwanted data in a file stream. For example I want to read in a list of doubles and only doubles from a file, if a non double is in the stream, some text for example, I need to flush it out of the stream and get the next item from the stream. The following code is in my textbook.
I just don't understand how to use it.Code:#define FLUSH while (fgetc(sp) !='\n')
Note: sp is the pointer to the file stream.