ok i'm just starting C++ and i did a little program to get if statements down but when i run it i get an error that says "ISO C++ forbids comparison between pointer and integer" and highlights this line:
here is my entire code:Code:if (age >= 18 && localQuestion == "yes") {
Code:#include <iostream> using namespace std; int main() { int age; char localQuestion; cout << "This program determines if you are eligeble to vote\n"; cout << "How old are you? "; cin >> age; cin.ignore(); cout << "Do you live in the U.S? "; cin >> localQuestion; cin.ignore(); if (age >= 18 && localQuestion == "yes") { cout << "You can vote\n"; } else { cout << "Sorry you can not vote\n"; } cin.get(); }



LinkBack URL
About LinkBacks


