trouble with char* equality
Code:
int main(int argv, char * argc[]){
// size array
if (argv!=5){
cout<<"baduser";
exit 0;
}
if((argc[1]=="-I")and(argc[3]=="-o"){
char * inputfile = argc[2];
char * outputfile = argc[4];
}else
//bad user
etc. etc.
this is code from the notes i've taken from the TA.
command line input is supposed to look something like this:
program -I input.txt -o output.txt
the if statement always passes to the else, how do i get it to equate the char* to what in my mind is a string? we havn't "learned" about strings so can't use that type. how do i get it to correctly check out that -I does infact equal -I?
also is all the spacing with the *'s correct? the TA draws on the chalkboard and i'm not 100% sure on the spacing.