I have this code snippet below. Is it correct to describe that sum will be 0
because sum++
will be ignored as assignment of sum +=
will be adding 0 before increasing the value? Or how is this best described? I mean if I use sum += sum + 1
the result is different.
int sum = 0;
for (int i = 0; i < 10; i++)
{
sum += sum++;
}
// Sum has end value 0