Structures are unique

added by sundarn85
11/14/2012 12:38:12 AM

0 Kicks, 61 Views

I recently stumbled upon this compile time error while trying to change the value of a structure over iteration. The Compiler throws this error when returned structure is modified. The reason is that structures are value types and immutable. The returned structure will be a copy. And any change to the copy doesn't reflect in the original structure hence the compiler prevents from doing this which is not intended.