int test[3] = {1,2,3};
cout<<test[3]<<endl;
// this will get a error
but
int test[3] = {1,2,3};
int (*A)[3];
A = &test;
cout<<test[3]<<(*A)[3]<<endl;
// this will print -858993460 withiout any errors
So could anyone tell me why? i am really confused by that.
in the first case why it is not outofboundary error but an undefined error? and why the second case will not get a error? i used to think they are the same...
actually i did know the array start from 0, i am confused by why the first got an error but the second won't????