+ 1

C program.....can anyone tell me how this program works line by line?

Why is i = a[i++]....after execution of that line i = 0? https://code.sololearn.com/c1XboMPEVTKq/?ref=app

12th Jun 2019, 3:32 PM
Abhijeet Pawar
Abhijeet Pawar - avatar
1 ответ
+ 1
Anything that has i on the left hand side and something like i++ or ++i on the right hand side of an equation leads to undefined behavior. i++; // correct x = i++; // correct i = i++; // wrong i=a[i++]++; // also wrong
12th Jun 2019, 3:59 PM
Anna
Anna - avatar