say I have the following:#include <stdio.h>#include <string.h>int main(int argc, char *argv[]){    if (argv[1] == -s) {        printf(success\n);    }    else{        printf(failed\n);    }return 0;}In the shell as I ran the executable file it prints failed..
Is the flag treated as string in c command argument?
c
That is because you can't do string comparison in C with == or != because those compare the base address, rather than the actual content. To properly compare the string in C you have to use strcmp.