It is an undefined behaviour since between two sequence points which is here ; at the end of this statement and the other ; which would be present above this statement in the actual code we cannot modify the value of a variable more than once therefore here u r trying to modify the value of n two times so it depends on compiler wither it will evaluate ++n inside array subscript or assign ++n to array index .