chap11/notional_gets.c
/* gets: read newline-terminated string from stdin into s.
 * This simple implementation does not handle errors. */
read newline-terminated string from stdin into s.
This simple implementation does not handle errors.
read newline - terminated string from stdin into s . This simple implementation does not handle errors .
char *my_gets(char *s) {
    int c;
    char *p = s;
    while (((c = getchar()) != EOF) && (c != '\n')) {
        *p++ = c;
    }
    *p = '\0';
    return s;
}
char * my_gets ( char * s ) { int c ; char * p = s ; while ( ( ( c = getchar ( ) ) != EOF ) && ( c != ' \n ' ) ) { * p ++ = c ; } * p = ' \0 ' ; return s ; }
gets: read newline-terminated string from stdin into s.
 This simple implementation does not handle errors.
gets : read newline - terminated string from stdin into s . This simple implementation does not handle errors .