All pastes #279061 Raw Edit

Untitled

public c v1 · immutable
·published 2006-12-14 17:38 UTC
rendered paste body
#include <stdlib.h>#include <stdio.h>int main(int argc, char *argv[]) {        int curcnt, maxcnt;        char c;        FILE *infile;        if (infile=(fopen(argv[1], "r") != NULL) {                ttlcnt = 0;                curcnt = 0;                while (!feof(infile)) {                        c = fgetc(infile);                        if (c == "\n") {                                curcnt++;                        } else if (c == "^L") {                                curcnt = curcnt--;                                if (curcnt > maxcnt) {                                        maxcnt = curcnt;                                }                                curcnt = 0;                        }                }                close(infile);        } else {                print("Could not open file\n");        }        print("Max line count is: %i\n", maxcnt);