Hi
I'm using something like this to give the user a way of choosing what effects to use in an audio processing console applictaion.
Code:
int Q;
cout << "Do you want to add effect?\n" << "1 for Yes or 0 for No." << endl;
cin >> Q;
if (Q == 1)
{
// EFFECT FUNCTION GOES HERE
}
else if (Q == 0)
// MOVES ONTO NEXT FUNCTION
how could I do this with strings? so the user would put "yes" or "no"? I have looked up sting.compare but I don't know how to apply it. I tried something like this.
Code:
string Q1("yes");
string Q2("no");
string Q3;
cout << "Do you want to add effect?\n" << "yes or no" << endl;
cin >> Q3;
if (Q3.compare(Q1));
{
// EFFECT FUNCTION GOES HERE
}
if (Q3.compare(Q2));
// MOVES ONTO NEXT FUNCTION
but it doesn't work (I type in "no" and it still runs the effect)
THANK YOU