GETS(3S) UNIX Programmer's Manual GETS(3S) NAME gets, fgets - get a string from a stream SYNOPSIS #include char *gets(s) char *s; char *fgets(s, n, stream) char *s; FILE *stream; DESCRIPTION _G_e_t_s reads a string into _s from the standard input stream stdin. The string is terminated by a newline character, which is replaced in _s by a null character. _G_e_t_s returns its argument. _F_g_e_t_s reads _n-1 characters, or up to (and including) a new- line character, whichever comes first, from the _s_t_r_e_a_m into the string _s. The last character read into _s is followed by a null character. _F_g_e_t_s returns its first argument. SEE ALSO ferror(3S), fread(3S), getc(3S), puts(3S), scanf(3S) DIAGNOSTICS _G_e_t_s and _f_g_e_t_s return the constant pointer NULL upon end of file or error. BUGS _G_e_t_s deletes a newline, _f_g_e_t_s keeps it, all in the name of backward compatibility. Printed 7/30/83 1