lvalue required as left operand of asssignment

55 Views Asked by At

I tried using a boolean expression while writing switch statementsenter image description here. What have I done wrong here and what does this statement - " lvalue required as left operand of asssignment " mean ?

I was expecting both conditions to work i.e

If user types smaller case y or uppercase Y it should not be a problem.

Keep in mind I am just a beginner at C++.

1

There are 1 best solutions below

1
Allan Wind On

You 2nd condition should be confirm=='Y' You have confirm='Y' and this assignment always evaluates to true. It's a common mistake.