While working on my CS project, I coded the following line:
if(...*stuff* || *morestuff* || *evenMOREstuff* || (strcmp(argv[5], "yes") && strcmp(argv[5], "no"){
cout << "Improper arguments."
exit(1);
}
else{ do more stuff}
Where argv[5] is a program argument supplied by the user. Either a yes or a no should return true; all other values cause the program to exit. The if() statement checks the values of all the program arguments, and if any one exceeds the limits it exits the program.
The reason I'm so confused is why my strcm comparison actually works. I've run it against multiple test cases, and each time it ONLY returns true if it's either yes or no. If anybody could explain my own genius to me it would be appreciated.