Hi everyone,
I need to read multiple lines (separated by newline) from the stdin stream. If I use fgets(...), it stops reading as soon as it entcounters the first newline (which isn't what I want). I can read from stdin character by character using fgetc(...), but how do I check when the end of input has been reached? comparing fgetc(...) with EOF or '\0' didn't work either. Can anyone help? Can't use '\' at prompt to indicate multiple lines of input either, since ultimately it's not going to be an interactive program.