I realize that there are some functions in the C language that have optional parameters, meaning a user can pass a NULL as a parameter value. I'm curious if this is possible using fgets().
Say I want to save an entire line in a file as a string, in other words, I want fgets() to stop when it reaches a newline character (\n), then could I do the following?
fgets(string, NULL, file); //where string is simply an array of char
I assume this is possible since fgets() always stops when it reaches a newline character, but if it is not possible, what would be the proper procedure to save an entire line as a string when one does not know the line length?