This program doesn't want to run, I don't see what's wrong with it
#include <iostream>
#include <string>
using namespace std;
int main()
{
string state;
cout<<"Enter the state abbreviation: ";
cin>>state;
if((state = "NC") || (state = "nc"))
cout<<"North Carolina";
if((state = "SC" || state = "sc"))
cout<<"South Carolina";
if((state = "GA" || state = "ga"))
cout<<"Georgia";
if((state = "FL" || state = "fl"))
cout<<"Florida";
if((state = "AL" || state = "al"))
cout<<"Alabama";
else
cout<<"You have entered an invalid abbreviation.";
cin.get();
return 0;
}
Why is it not taking the OR symbols, why does it say there is no match for it???
It just keeps saying things like "error, no match for 'operator||' in '"GA" || 'state'
ARGH, I think I did the old equal sign mistake on this one
Yep that was it, sorry about that
Last edited on
Please, mark this as solved so others won't click this thread.
Last edited on