I am trying to do a command line switch with an if statement. The problem I am running into is when I am using a letter, it wont recognize it. When I use a number, no problem. I think there are a few different ways to solve this. Can anyone show me the most direct way?
Thanks.
#include <iostream>
using namespace std;
int main ( int argc, char *argv[] )
{
if (argv[1] == "-d")
{
cout<<"yes, it works"<<endl;
}
else
{
cout<<"no, it won't read the if statement"<<endl;
}
}