Pset5- Why use fgetc instead of fscanf?
questions.txtの5問目。
cs50.stackexchange.com
“words in that file will not always end with a space or line return. Many will be followed by a period or comma, for example, which fscanf will see as being part of the word.”
“fgetc() reads character-by-character from a stream. This will enable us to keep track of the number of chars we read, while using fscanf(), on the other hand, might get us into trouble if a longer string than we expect was read.
This might overwrite other important data in memory or probably makes our program exist with a segmentation fault.”