How the value of m is 2 after execution as i is postfix ?
int main()
{
int i,m;
int a[5]={8,10,1,14,16};
i=++a[2];
m=a[i++];
cout<<i<<m;
return 0;
}
How the value of m is 2 after execution as i is postfix ?
int main()
{
int i,m;
int a[5]={8,10,1,14,16};
i=++a[2];
m=a[i++];
cout<<i<<m;
return 0;
}
Your code can be broken down to following statements:
This is how m = 2 happens!