Detecting EOF with fgets() where filesteam is stdin
问题 Bit of background, I'm writing a program that plays the game "boxes" it runs in linux command line and is written in C. There's a prompt that waits for user input and then is read with fgets() and interpretted etc. As part of the task specification I have to return a specific error if I reach "End of file while waiting for user input". I understand that fgets() returns null when it reaches EOF... but say I have fgets(input,max_buffer,stdin); in a prompt loop if the user exits prematurely say