I am trying to use fgets to call different functions depending on what the string the user inputs. I know I will need to use strtok later since there will be spaces for, for example, "load 12". But now, I am confused about using strcmp to compare strings being input. I know strcmp can be used like this:
int check;
char string[10] = "test";
check = strcmp(string, "test");
// Check will be 0 if true
if (check == 0)
{
printf("same string\n");
}
else
{
printf("not the same\n");
}
Can it be a boolean value like true and false? If "test" is actually "test", boolean value becomes true, then I will use the boolean value in the if
statements.