Annotation of 42BSD/usr.lib/learn/C/getnum.c, revision 1.1

1.1     ! root        1: #include <stdio.h>
        !             2: 
        !             3: getnum()
        !             4: {
        !             5:        int c, n;
        !             6: 
        !             7:        n = 0;
        !             8:        while ((c=getchar()) >= '0' && c <= '9')
        !             9:                n = n*10 + c - '0';
        !            10:        if (c == EOF)
        !            11:                return(-1);
        !            12:        return(n);
        !            13: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.