I'm studying C, and now trying to pass parameters. Well, although I'm thinking I got it, it's giving me an error when I try to use that variable ...
I need to compare the "argument_value" char to make decisions in the program!
What can I be doing wrong?
int main (int argument_count, char *argument_value[]) {
printf("\n");
printf("\nargument_value[0] : %s", argument_value[0]);
printf("\nargument_value[1] : %s", argument_value[1]);
printf("\nargument_value[2] : %s", argument_value[2]);
printf("\n");
if (argument_value[1] == "detailed"){printf("\n detalllll");}
else if (argument_value[1] == "hexa") {printf("\n hexaaaaaa");}
else if (argument_value[1] == "bits") {printf("\n bitsssss");}
else {printf("\n none...");}
}
This code always returns me the parameters that pass in the command line, and "none ..."