basics · beginner · ~15 min
Use the sign convention of strcmp.
Implement int str_eq(const char *a, const char *b) returning 1 if equal else 0 (using strcmp is allowed).
#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.