Today when i was coding inside my visual studio i unintentionally did following
for(int i=0;i<10;i++)
{
cout<<"Value is"<<[i]arr<<endl;
}
instead of arr[i] and it worked.why it worked?
Today when i was coding inside my visual studio i unintentionally did following
for(int i=0;i<10;i++)
{
cout<<"Value is"<<[i]arr<<endl;
}
instead of arr[i] and it worked.why it worked?
Because [i]arr == *(i + arr) == arr[i]
Note: +
operator holds commutative
property