This may seem simple but i cant figure it out:
I want to be able to pass a single argument to my program and i can do this, i can also get it to print to stdout but when i try to use an 'if' statment with argv it just goes to my else even if it matches with the if.
an example similar to my basic prog:
int main(int argc, char *argv)
cout<<argv<<endl; //this prints out "foo"
//assuming i used arg "foo"
else if(argv == "foo")
cout<<"no argument\n"; //this is what prints
//even if i use "foo"
//as an argument
sorry if this seems too basic but i am getting a headache trying to figure it out. What am i doing incorrectly?