Why is a postfix increment (++) operator not allowed after int.parse("1")?
.net, c#
Solution
Doe this make sense to you? Because it is exactly same thing.
var result = (int.Parse("1") = int.Parse("1")+1);
You sure you can assign to a method?
Problem
When you use int.Parse("1") as the operand of the postfix increment ++ operator: ``` var result = int.Parse("1")++; ``` The C# compiler shows an error with: The operand of an increment or decrement operator must be a variable, property or indexer. Which I can understand for the prefix in- or decrement operator, but not for the postfix in- or decrement operator. In the case of the prefixed operator, there is no value to perform an operation on, but in the postfix case there will always be a value. The same with a property, which is behind the scenes a "getter" and thus returns a value in the same way (assumption, not checked in IL). What am I missing here?