In my programming class we currently have a project that requires us to take arguments into the program. I then need to be able to check one of the arguments to see which value was passed to the program so that I can choose the appropriate behavior for the program to follow. In a previous homework assignment I did this with the strcmp function included in the cstring library using the following code:
int main(int argc, char *argv[]) {
if (strcmp(argv[1], "yes") == 0) {
// do this code
} else if (strcmp(argv[1], "no") == 0) {
// do this code
}
}
However, for some reason we re not allowed to use the cstring library in this project. How else can I do this?