I am reviewing a code with the following snippet for minimal reproducible example. So here the code runs an iteration to initialize an array done as follows:
#include <stdio.h>
int i,j;
N=10;
int done[500];
void main() {
done[0]=done[N]=1;
for(i=0;i<N+1;done[i++]=0){
printf("Done val %d iteration %d\n",done[i],i);
}
}
The thing I am concerned with that I purpossely initialized the values of done[0]=done[1]=1 However when I run the initialization loop, the values at index 0 and 10 remains unchanged. I would like to understand how is the syntax of done[i++] actually evaluated?
N=10anddone[N]=1.done[10] = done[0]=1soN=10