I’m using eclipse.
I declared #define OUTPUT_FLAG "-o"
and then, I have the main : int main(int argc, char **argv)
after that I write:
for (int i = 1; i < argc; i+=2)
{
if(argv[i]==INPUT_FLAG)
{
cout<<"input flag\n";
input_file=argv[i+1];
}
}
and there I get the error on the subject. Can you help me here?
Thank you
You cannot compare strings with
==in C++. You either have to usestrcmpor convert them tostd::strings and then use the==operator. That is, either:or