/* version.c * Neal Nelson * * Just copy the /proc/version to stdout in 80 character blocks until EOF */ #include #define MAXLINE 80 main() { char buf[MAXLINE+1]; /* room for the string terminator zero */ FILE *fp; fp = fopen("/proc/version", "r"); /* fgets reads one less than specified number of characters and adds zero*/ while (fgets(buf, MAXLINE+1, fp) != NULL ) { printf("%s",buf); } }