As @JeremyLT says, there’s no #include for the string library in the code you’re displaying. What that means is you’re (potentially) aliasing the strcmp function with garbage (since you’re not providing a strcmp definition). But if the code is compiling and running, this is unlikely.
You’re calling fgets incorrectly. fgets expects a char * as the first argument, and that’s not what you’re passing in. So you’re comparing “Tom” to whatever garbage happens to be in memory starting at name[0]. Try calling fgets(&name,…)
Hi sorry, I’m not really familiar with C, but when I google stuff out, some forums say that I should be using a function like that so I tried running it, and the result is as shown. I’m still new to C so I haven’t gotten to importing stuff yet