Search code examples
fgets

What does fgets return when EOF is found?


does it return anything? is EOF nothing but -1 ? How does fgets detect an EOF ? Can somebody please elaborate also on the difference between gets and fgets()


Solution

  • It returns NULL on encountering EOF