Hi
I got this code:
(hours_worked-35)=overtime_hours;
(overtime_hours)-(hours_worked)=normal_hours;

I get this error:
error C2106: '=' : left operand must be l-value

What does this mean?

Recommended Answers

All 5 Replies

Simply said : don't use a minus operator on the left side of an assignment operator.

> (hours_worked-35)=overtime_hours;
result = value;
copies value INTO result, not the other way round.

this error is still buggin me, i am doing a-levels and its due tomorrow. i tried the above and it doesnt work???

What they are trying to tell you is that you should always start these kinds of statements with the destination of outcome: outcome = 3-4; will result in 'outcome' being -1 3-4 = outcome; will result in your error

> this error is still buggin me, i am doing a-levels and its due tomorrow. i tried the above and it doesnt work???
And you couldn't have said this at any time in the 14 days between now and your previous post?

Like a week ago, where we would have had plenty of time to walk you through it.

Now why is that (not that I really care about your answer)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.