ok let me break this down this:
Code:
#include <iostream>
using namespace std;
int main()
{
int answer;
cout<<"Do cows fly? yep or nope?";
cin>> answer;
cin.ignore();
if ( answer == yes ) {
cout<<"Correct!";
}
else if ( answer = no ) {
cout<<"You are terribly mistaken!";
}
else {
cout<<"Invalid answer";
}
cin.get();
}
doesn't work. While this:
Code:
#include <iostream>
using namespace std;
int main()
{
int answer;
cout<<"Do cows fly? yep or nope?";
cin>> answer;
cin.ignore();
if ( answer == 1 ) {
cout<<"Correct!";
}
else if ( answer = 0 ) {
cout<<"You are terribly mistaken!";
}
else {
cout<<"Invalid answer";
}
cin.get();
}
works, how can i make the yes and no not register as a function.