When I run this program with the input 700 and then give standard input :
total 329
-rwx------  1 reid  staff    1734 Jun 22 14:52 prog
-rw-------  1 reid  staff   21510 Apr  6 12:10 tmp.txt
-rwxr-xr-x  1 reid  staff    8968 Feb  1 2013 xyz
-rw-r--r--  1 reid  staff      88 Feb 15 2013 xyz.c
I expect to see 3, as there are three files with size greater than 700. However, the program returns 0. What is the issue?

    int main(int argc, char** argv) {
    if (!(argc == 2 || argc == 3)) {
        fprintf(stderr, "USAGE: count_large size [permissions]\n");
        return 1;
    }

    // TODO: Process command line arguments.
    // allocating memory and skipping the first line of ls input
    char **perm_list = malloc(100 * sizeof(char*));
    int mem_list[100];
    scanf("%*s %*s ");
    char directory;
    char *permissions = malloc(11*sizeof(char));
    char mem[9];
    // iterating over the stdin, and reading the required values. Turning the size into 
    int size = 0;
    int i = 0;
    while (-1 != scanf("%c%s %*s %*s %*s %s %*s %*s %*s %*s", &directory, permissions, mem)) {
        if (directory == '-') {
            perm_list[i] = permissions;
            mem_list[i] = strtol(mem, NULL, 10);
            i ++;
            size ++;
        }   
    }

    // TODO: Call check_permissions as part of your solution to count the files to
    // compute and print the correct value.
    int count = 0;
    int lower = strtol(argv[1], NULL, 10);
    if (argc == 2) {
        int j;
        for (j = 0; j < size; j ++) {
            if (mem_list[i] > lower) {
                count ++;
            }
        }    

    }
    }