Namespaces
Variants
Views
Actions

getchar

From cppreference.com
< c‎ | io
 
 
File input/output
Types and objects
        
Functions
File access
(C95)
Unformatted input/output
getchar
(until C11)(C11)
(C95)(C95)
(C95)
(C95)(C95)
(C95)
(C95)

Formatted input
 
Defined in header <stdio.h>
int getchar( void );

Reads the next character from stdin.

Equivalent to getc(stdin).

Contents

[edit] Parameters

(none)

[edit] Return value

The obtained character on success or EOF on failure.

If the failure has been caused by end-of-file condition, additionally sets the eof indicator (see