So, as the name implies, I have a function that uses a temporary array, and I want to write a value from another array into it, and then multiply the two values by myself.
Example:
float[] a = {0, 0}
a[0] *= a[0] = b[n ];
a[1] *= a[1] = b[n + 1];
I would expect the above to do the following:
a[0] = b[n ];
a[0] *= a[0];
a[1] = b[n + 1];
a[1] *= a[1];
Although this behavior is not like what is happening. Instead, it simply multiplies by the fact that the original value contained in “a” was with any value contained in “b” as follows:
a[0] = a[0] * b[n ];
a[1] = a[1] * b[n + 1];
I always understood that everything that comes after evaluating "=" is first evaluated, as you can see, when you do:
float a, b;
a = b = 5;
//"a" and "b" both equal "5" now.
Anyway, wouldn't it show that my original example should work?
- , , , ?