What's wrong here?

Something is wrong with this function, the change is always 0 no matter what.
How can I fix this?

1
2
3
4
5
6
7
8
9
10
11
12
13
...



	else if(change = 0)
	{
		cout << name << ", you should pay all your money to buy " << weight << " kg of " << vegetable << "."<<endl;
		cout << "		(1) Do you want to start over?"<<endl;
		cout << "		(2) Do you want to change your kilogram selection for " << vegetable << "?"<<endl;
		cout << "		(3) Do you want to continue without any change?"<<endl;
		cout << name << ", please select one of the above (1/2/3): ";
		cin >> answer2;
Last edited on
Line 42 is an assignment. To compare use ==.
Topic archived. No new replies allowed.