getchar()与putchar()

  getchar () for reading a single character from the user keyboard input, it has an integer return value, when a read error occurs when the integer return value of -1, when the read right time, it will return the user ASCII code from the first character of the keyboard input,

When the program calls getchar. When you run the program waiting for user input from the key, character entered by the user is stored in the keyboard buffer until the user presses ENTER (carriage return character also in the buffer), when the user types after a carriage return, getchar before the beginning of each read a character from the input stream, the characters entered more than one time

 

 the putchar () to output a character to a terminal.

 

Guess you like

Origin www.cnblogs.com/focusonoutput/p/12453289.html