Hello,
I'm new to C++ and I was wondering how to compare two characters... Right now I'm using:
But it's not working, because it doesn't execute the command after the first if (assuming both chars match).Code:char *o; printf("Try Again? (n/y): "); scanf("%c", &o); int res = strcmp(o,"y"); if (res == 0){ system("CLS"); goto calculate; } else if (res < 0 || res > 0) { printf("\n\n%c\n",o); printf("See ya!...\n"); }
Thanks in advance!



Reply With Quote