Hey guys, i'm having some trouble using chars with if's. I have used const chars but they are really irritating because I need to change the char later on in the program.
here is what I want to do:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#import <iostream>
usingnamespace std;
int main() {
char YN;
cout << Please enter Yes or No;
cin >> YN;
if (YN == "Yes"){
cout << "You said yes";
}
if (YN == "No") {
cout << "You said No";
}
return 0;
}
I want to do something along those lines but without using const chars.
That your program works it is enough to change the type char to std::string of variable YN. For example. By the way instead of directive #import you shall use directive #include