关于c++中的数组指针使用的一个问题

int test[3] = {1,2,3};

cout<<test[3]<<endl; // 会报错

但是

int test[3] = {1,2,3};

int (*A)[3];

A = &test;

cout<<test[3]<<(*A)[3]<<endl; // 输出 -858993460

则不会报错有没有人 知道为虾米啊。。。 困惑啊。。 我素菜鸟 求指导。。。

posted on 2011-08-26 21:39  11111010  阅读(80)  评论(0)    收藏  举报