C++中是否有像Java那样的ArrayList<String>集合?

Is there any ArrayList<String> collection in C++ like in Java?

本文关键字:String lt gt 集合 ArrayList 是否 Java C++      更新时间:2023-10-16

我在java类中使用本机函数。

我写了一个c++函数用于XML解析。

我的问题是,解析XML后,我必须存储节点名称到字符串数组,但我不想固定它的大小。

你在找这个吗?

vector<string> var;
http://en.wikipedia.org/wiki/Vector_%28C%2B%2B%29

它的使用方式基本相同,只是方法名不同。

有STL提供的std::vector<std::string>

std::vector的文档