Get a character from stdin.
Include
<stdio.h>
Prototype
int getchar(void);
Return Value
Returns the character read or EOF if a read error occurs or end-of-file
is reached.
Remarks
Same effect as fgetc with the argument stdin.
Example
#include <stdio.h>
int main(void)
{
char y;
y = getchar();
printf("%c|", y);
y = getchar();
printf("%c|", y);
y = getchar();
printf("%c|", y);
y = getchar();
printf("%c|", y);
y = getchar();
printf("%c|", y);
}
Example Input
Contents of UartIn.txt (used as stdin input for
simulator):
Short
Longer string
Example Output
S|h|o|r|t|