Can anyone explain how the following code could be explained, I dont understand it really.
while((c = getchar()) != \'\\n\' && c != EOF);
This code, assuming the file (or some other input) has been opened, will continue to get character by character until it finds a newline (\n) or an end of file (eof).
fflush will just clear the stream for an open file.