I have the following code written in both C++ and C#
int i=0;
++i = 11;
After this C# compiler brings an error
The left-hand side of an assignment must be a variable, property or indexer
But C++ compiler generate this code with no error and I got a result 11
for value of i
. What's the reason of this difference?
someArray[++i] = 11
would make more sense. – Freud