Borland C++ reference

getc

raw OCR

Gets character from stream.

Defined in header <stdio.h>

Syntax

#include <stdio.h>
int getc(FILE *stream);

Portability

DOSUNIXWindowsANSI CC++ only
■■■■

Remarks

getc is a macro that returns the next character on the given input stream and increments the stream's file pointer to point to the next character.

Return value

On success, getc returns the character read, after converting it to an int without sign extension. On end-of-file or error, it returns EOF.

See also

Example

#include <stdio.h>

int main(void)
{
   char ch;
   printf("Input a character:");

   /* read a character from the  standard input stream */
   ch = getc (stdin);
   printf("The character  input was: '%c'\n", ch);
return

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.