reads from a stream a single character.
get_char/1 reads a single character from the current input stream.
get_char/2 reads a single character from the stream named in the first argument.
get_char reads the character at the current stream position and unifies it with Char. If the stream position is behind the end of stream, Char will be unified with the atom end_of_file.
Stream text input stream Char character or end_of_file
Assume the content of a stream S is abcdefg and the stream position is at the 1st character.
| get_char(S, 'a'). | Succeeds. The stream position will be advanced by one character. |
| get_char('d'). | Fails. The stream position will be advanced by one character. |
These predicates are part of the ISO-Prolog Standard.
get_code/1/2, peek_char/1/2, peek_code/1/2, put_char/1/2, put_code/1/2, nl/0/1, set_input/1, current_input/1.