cybersecurity · beginner · ~15 min

Does it contain a special character?

Detect non-alphanumeric characters.

Challenge

Implement int has_special(const char *pw) returning 1 if pw contains at least one character that is not a letter or digit, else 0.

Starter code

int has_special(const char *pw) {
    /* TODO */
    return 0;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.