getchar - GETS(3 Linux Programmer’s Manual GETS(3 NAME...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
GETS(3) Linux Programmer’sManual GETS(3) NAME fgetc, fgets, getc, getchar ,gets, ungetc - input of characters and strings SYNOPSIS #include <stdio.h> int fgetc(FILE * stream ); char *fgets(char * s ,int size ,FILE * stream ); int getc(FILE * stream ); int getchar(void); char *gets(char * s ); int ungetc(int c ,FILE * stream ); DESCRIPTION fgetc() reads the next character from stream and returns it as an unsigned char cast to an int ,or EOF on end of file or error. getc() is equivalent to fgetc() except that it may be implemented as a macro which evaluates stream more than once. getchar() is equivalent to getc( stdin ) . gets() reads a line from stdin into the buffer pointed to by s until either a terminating newline or EOF , which it replaces with ’\0’ .Nocheck for buffer overrun is performed (see BUGS below). fgets() reads in at most one less than size characters from stream and stores them into the buffer pointed to by s .Reading stops after an EOF
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online