I would like some help to check if I am understanding this properly.
Lesson 9 - Cstrings (cprogramming.com) states
"fgets will read input until it either has no more room to store the data or until the user hits enter." (the user can only hit enter once for this type of input? we can not use "paragraphs" if you know what I mean?)
"The one thing to watch out for when using fgets is that it will include the newline character ('\n') when it reads input unless there isn't room in the string to store it. This means that you may need to manually remove the input. One way to do this would be to search the string for a newline and then replace it with the null terminator."
Why do we need to remove the newline character?
a. because when we call the string to printf it will print the text and the actual backslash n ('/n')
b. if our array is 256 in size and the newline character is stored in the last element array[255] we need to remove it to fit the null character '\0', otherwise we cant call the string
or is there another reason we need to get rid of the newline character?
thanks