感谢:http://topic.csdn.net/t/20050429/20/3976956.html
感谢:http://yzyanchao.blogbus.com/logs/47796444.html
不过那边是转载自《effective stl》。
std::vector很方便,但有时调用的函数的参数规定是数组,需要将vector转为数组,另外开辟一个空间,将vector一项项复制过去代价过大,可用下面的方法。
给定一个
vector<int[......]
STL中vector转数组(实际是数组的指针)
Leave a reply