How to check if a variable has a certain string in it? How to do it in an if condition? [duplicate]

So far I've got the following:

#include <stdio.h>
#include <unistd.h>
#include <math.h>
#include <string.h>

int main (void)
    printf("Loading BES Command Prompt...\n");
    printf("> ");
    char *input;
    scanf("%s", input);
    if (input == "exit")
        printf("Terminating BEScmd.c...\n");
        return 100;

However I need help because it won't use printf("Terminating BEScmd.c...\n"); and the compiler says it aborts with the Exit Code "0", not "100" which is what I want it to stop with.

Can you please help me here?

Read more here:

Content Attribution

This content was originally published by BraveGamerTV at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: