1: /*	@(#)gets.c	2.1	SCCS id keyword	*/
   2: #include    <stdio.h>
   3: 
   4: char *
   5: gets(s)
   6: char *s;
   7: {
   8:     register c;
   9:     register char *cs;
  10: 
  11:     cs = s;
  12:     while ((c = getchar()) != '\n' && c >= 0)
  13:         *cs++ = c;
  14:     if (c<0 && cs==s)
  15:         return(NULL);
  16:     *cs++ = '\0';
  17:     return(s);
  18: }
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 685
Valid CSS Valid XHTML 1.0 Strict