I need help with making an if statement that checks for if the argument when a function is run is either -encode or -decode. This is what I have so far. How would I go about fixing this? I'm confused as to how to ask the if statement to check if argv[1] == -encode and vice versa. Any help help would be appreciated!
Well I technically haven't written the functions for encode and decode. But the user uses the argument
./prog -encode 4 //4 is a number that will be used in the encode function
to tell the program to encode. Then the user types in a string and the encoder encodes it. I just couldn't figure out how to get the if statement to recognize the -encode part.