Hi guys,
I have a headache for the last two days because of this program, I tried everything i could think of. I tried constant variables too and I just can't get it to work. so please help good people.
cout<< " Enter 1 for chair or 2 for table"<< endl;
cin >> choicefurniture;
cout << " Enter 1 for red, 2 for black or 3 for green"<<endl;
cin>>choicecolor;
if (choicefurniture=='1')
{ furniturecode=="c47";
}
else if (choicefurniture=='2')
{furniturecode=="t47";
}
if (choicecolor == '1')
{furniturecolor=="42";
}
else if (choicecolor=='2')
{furniturecolor=="25";
}
else if (choicecolor=='3')
{furniturecolor=="30";
}
else
cout<<"invalid output"<<endl;
You're using an == to assign a value. == is a comparison operator, like you used int he if/else if statement. To assign a value, you need to use only one equal sign.