I am creating a game of chess and have this line of code:
void (!selectedPiece.moved && selectedPiece.moved = true);
What it does, is check if selectedPiece.moved is false, and if it is, continue and set selectedPiece.moved to true.
As @Klaycon said, it reads it like this:
void (!selectedPiece.moved && selectedPiece.moved) = true;
And that is when I get an invalid left-hand side assignment. I know I could replace it with an if statement but I was wondering if there was something else I could do to fix it.
(!selectedPiece.moved && selectedPiece.moved) = true, hence the "invalid left-hand side assignment".