fgetchar >> Gets Character from stdin >> Stdio.h Header FilePritesh
- fgetchar gets a character from stdin
- The fgetchar() function is equivalent to fgetc() with the argument stdin.
/* prompt the user for input */
printf("Enter a character : ");
/* read the character from stdin */
ch = fgetchar();
/* display what was read */
printf("The character read is: '%c'",ch);
Return Type :
- On Success : Next character from the input stream pointed to by stdin.
- On end-of-file : Returns EOF
- On error : Returns EOF