Expression must be modifiable lvalue error.

I don't quite understand, why? It's on the seconds variable in the if statements.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
int Math(int &seconds, int &attempts, bool &firstpass)
{
	static int TIME_PENALTY = 1200;

	if (seconds > 0 && attempts > 1 && firstpass = true)
	{
		seconds = seconds + attempts * TIME_PENALTY - TIME_PENALTY;
		firstpass = false;
		return(seconds);
	}
	if (seconds > 0 && firstpass = false)
	{
		firstpass = true;
		return(1);
	}
	return(seconds);
}
Last edited on
= assignment
== equal to

firstpass == true instead of firstpass = true
Last edited on
Topic archived. No new replies allowed.