in visual studio c++ 6.0 why does this error come and how to get rid of this??
Home
/
Programming & Design
/
what is the cause behind " error C2106: '=' : left operand must be l-value "?
in visual studio c++ 6.0 why does this error come and how to get rid of this??
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Verified answer
Quote from Wiki:
Lvalues are values that have addresses being programmatically accessible to the running program (e.g., via some address-of–operator like "&" in C/C++), meaning that they are variables or dereferenced references to a certain memory location.
End Quote
This means that you try to assign a value into something that is not a variable. A sample would be:
6 = num;
Since 6 is not a variable, it cannot be assigned to, and will produce the said error.
Try to check if this occurs in your program. Check the if, for and while because these are the common place where a "=" is being used instead of "==".
Hope this helps.
You have an assignment statement. Should this be a comparison ==?
The left operand of the assignment is of the wrong type.
Without seeing the code I can add no further comment.
Have fun.
show us the code.