vector与string进行下标访问时,其下标为无符号类型。
而数组
例如
int array[3]={1,2,3};
int *p=&array[2];
std::cout<<p[-1]<<std::endl;
//则会输出元素array[1]即2