Home > Back-end >  While (the scanf (" % s ", p)! Why can't=(EOF) cycle end?
While (the scanf (" % s ", p)! Why can't=(EOF) cycle end?

Time:10-24

P is a pointer variable, after running the program input more groups of data with the blank space disconnected, but end of loop program has an infinite loop, is this why?

CodePudding user response:

Use Ctrl + D (Linux) or Ctrl + Z (Windows) input end

CodePudding user response:

EOF marks end of file, the standard input to input EOF combined through input keyboard key, CTRL + d (Linux) or CTRL + z (Windows)

CodePudding user response:

The standard input how to judge whether the data end?

CodePudding user response:

The
reference 3 floor Micope response:
how to determine the standard input data whether to end?

Enter CTRL + d or CTRL + z is said file at the end of the scanf returns EOF.

CodePudding user response:

VS three times in the continuous input & lt; CTRL + z> To Enter

CodePudding user response:



CodePudding user response:

LINUX: CTRL + d, Windows: CTRL + z input EOF
  • Related