Kodewick
Start learning →
Starter←→0 / 70

The password

#041StarterStringsConditions3 min

To get into the tree house you say the password pumpkin. Write is_secret_word(word): return true if word is exactly "pumpkin" (same case), otherwise false. In C you can't compare two strings with ==.

Examples
is_secret_word("pumpkin")→True
is_secret_word("potato")→False
The functionbool is_secret_word(const char *word)
main.c
#include <stdbool.h>
#include <string.h>

bool is_secret_word(const char *word) {
    bool ok = false;
    // your code here: compare with strcmp; 0 means the same
    return ok;
}
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.