basics · beginner · ~15 min

Strings equal

Use the sign convention of strcmp.

Challenge

Implement int str_eq(const char *a, const char *b) returning 1 if equal else 0 (using strcmp is allowed).

Starter code

#include <string.h>

int str_eq(const char *a, const char *b) {
    /* TODO */
    return 0;
}

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