Why do i have to input EOF 3 times when using fgets?
First of all, ^Z or ^D are control characters that mean something to the terminal you are using, and sometimes that means for the terminal to signal end-of-file condition. Anyway, your three keypresses are processed by the terminal to take the following actions, after entering text: Flush the input (i.e. send the characters that have … Read more