Hey all. I've been working on some fun with C and decided to write a Rock Paper Scissors game. The problem is, that when I try to compile the file, it gives "lvalue required as left operand of assignment" error. The error line is here:
for ((point1=0 && point2=0); ((point1=3) || (point2=3)); randStart++) {
point1, point2 and randStart are integer values by the way.
I use gcc and vim (which I doubt will help) and can give you all the code, if necessary.
A little explanation of an "lvalue" might be in order.
An "lvalue" is something that can have the result of any computation assigned to it - it's pretty much some location in memory where you can put values. The statement "int abc;" declares and integer variable "abc", which can be an lvalue. The address of abc - "&abc" - is not an lvalue, because you can't assign a result to that - the address of the variable is the address. You can assign something to where that address points to by using the "" operator, so "( &abc )" is actually an lvalue. The integer constant "3" is not an lvalue.
The concept of an lvalue is pretty simple once you realize what it means.