有个容器vector,怎么查看这个容器的起始地址

来源:百度知道 编辑:UC知道 时间:2024/05/27 06:36:21
RT

vector <int> c1;
......
vector <int>::iterator c1_Iter = c1.begin();

难道这样不行吗?

这个类模板里有个指针变量成员,是指向数据起始地址的。不过是受保护类型,不能访问,你继承一下,加个访问函数不就可以了??

vector <int> v1;
v1.begin();