updating oE getc


<built-in> function getc(integer fn) 

gets the next character (byte) from a file or device fn.

  1. fn : an integer, the handle of the file or device to read from.

An integer, the character read from the file, in the 0..255 range. If no character is left to read, EOF is returned instead.


The target file or device must be open.


File input using getc is buffered, that means getc does not actually go out to the disk for each character. Instead, a large block of characters will be read in at one time and returned to you one by one from a memory buffer.

When getc reads from the keyboard, it will not see any characters until the user presses Enter. Note that the user can type Control+Z, which the operating system treats as "end of file" returning EOF.

See Also:

gets, get_key

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu