Error: “Cannot modify the return value” c#

This is because Point is a value type (struct). Because of this, when you access the Origin property you’re accessing a copy of the value held by the class, not the value itself as you would with a reference type (class), so if you set the X property on it then you’re setting the property on the copy and then discarding it, leaving … Read more