getchar
- Updated2023-02-21
- 1 minute(s) read
getchar
int getchar (void);
Purpose
Returns the next character from the input stream pointed to by the standard input. If the stream is at end-of-file or a read error occurs, the end-of-file indicator for the stream is set and the function returns EOF (-1).
![]() |
Note This function is equivalent to getc(stdin). |
Parameters
None.
Return Value
Name | Type | Description |
characterRead | int |
Contains the next character from the input stream pointed to by stdin. Two cases cause the function to return EOF (-1):
|
Additional Information
Library: ANSI C Library
Include file: ansi_c.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later
Example
Refer to userint\standardio.cws for an example of using the getchar function.