using fgets and strcmp in C [duplicate]
问题 This question already has answers here : strcmp on a line read with fgets (6 answers) Closed 6 years ago . I'm trying to get a string input from the user and then run different functions depending on the input they've entered. For example, say I asked, "What is your favorite fruit?" and I want the program to comment depending on what they enter...I'm not sure how to do this. Here's what I have so far: #include <stdio.h> #include <string.h> char fruit[100]; main() { printf("What is your