GETS(3S) UNIX Programmer's Manual GETS(3S) NAME gets, fgets - get a string from a stream file SYNOPSIS #include char *gets (s) char *s; char *fgets (s, n, stream) char *s; int n; FILE *stream; HP-UX COMPATIBILITY Level: HP-UX/RUN ONLY Origin: System V DESCRIPTION _G_e_t_s reads a string into _s from the standard input stream stdin. The string is terminated by a new-line 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 a new-line character (which is retained), whichever comes first, from the _s_t_r_e_a_m into the string _s. The last character read into _s is fol- lowed by a null character. _F_g_e_t_s returns its first argu- ment. SEE ALSO ferror(3S), fopen(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.