0
How do I set two value to a string code below
string yes_vary; yes_vary = "Yes","sure"; if(a==yes_vary) { cout << " it works" << endl; }
2 odpowiedzi
+ 4
You can't store two strings in one string variable, but you can check more than 1 condition in one if statement.
if (a == "Yes" || a == "sure") {
// It works
}
0
I want to be able to enter yes or sure and the program output the same thing but the problem is this.
yes_vary = "Yes","sure";
I want it to be
string yes_vary;
yes_vary = "Yes" or "sure";