Q:

Why am I unable to generate more than 1 random string?

My code here will always generate one string of length MAXLEN but then start generating strings with a lower length. I'm not certain of why this is happening.
void generate_strings(int n) {
    char genvals[] = "abcdefghijklmnopqrstuvwxyzABC"
                     "DEFGHIJKLMNOPQRSTUVWXYZ0123456789 ";
    char str[MAXLEN + 1];
    int i = 0, j = 0;
    for (i = 0; i < n; i++) {
        for (int j = 0; j < MAXLEN; j++) {
            str[j] = genvals[rand() % strlen(genvals) - 1];
        }
        str[MAXSTRLEN] = '\0';
        printf("%s\n", str);
        memset(str, 0, MAXLEN);
    }

}

A:

A couple of changes:
1) As dazedandconfused pointed out in his answer, you need to seed the random number generator.
2) Don't calculate the length of genvals more than once.
3) Your indexing into genvals was incorrect.
4) The call to memset was unnecessary.
void generate_strings(int n) {
    srand(time(NULL)); // seed the random number generator
    char genvals[] = "abcdefghijklmnopqrstuvwxyzABC"
                     "DEFGHIJKLMNOPQRSTUVWXYZ0123456789 ";
    size_t length = strlen(genvals); // only calculate this once
    char str[MAXLEN + 1];
    int i = 0, j = 0;
    for (i = 0; i < n; i++) {
        for (int j = 0; j < MAXLEN; j++) {
            str[j] = genvals[rand() % length];
        }
        str[MAXLEN] = '\0';
        printf("%s\n", str);
    }
}

