I am trying to compare the parameter of command with argv[] but it's not working. Here is my code.
./a.out -d 1
In main function
int main (int argc, char * const argv[]) {
if (argv[1] == "-d")
// call some function here
}
But this is not working... I don't know why this comparison is not working.
See Question&Answers more detail:os