getchar reads one character from stdin. On success, the read character is returned. EOF is returned on end of file or if an error occurred.