Xinu7/man/man3/gets.doc




GETS(3)             Xinu Programmer's Manual              GETS(3)



NAME
     gets, fgets - get a string from a device

SYNOPSIS
     #include <io.h>

     char *gets(s)
     char *s;

     char *fgets(dev, s, n)
     int  dev;
     char *s;
     int  n;

DESCRIPTION
     _G_e_t_s reads a string into _s from the standard input device,
     CONSOLE.  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 a newline character,
     whichever comes first, from device _d_e_v into the string _s.
     The last character read into _s is followed by a null charac-
     ter.  _F_g_e_t_s returns its second argument.

SEE ALSO
     getc(2), puts(2), scanf(3), fread(3),

DIAGNOSTICS
     _G_e_t_s and _f_g_e_t_s return SYSERR if an error results.

BUGS
     _G_e_t_s deletes a newline, _f_g_e_t_s keeps it, all in the name of
     backward compatibility.





















Version 6b               Printed 1/12/87                        1