Is there any ArrayList<String> collection in C++ like in Java?
I am using native function开发者_开发百科 in my java class.
I have written C++ function for XML parsing.
My problem is that after parsing XML, i have to store node names into string array, but i dont want to fix its size.
Like java, C++ have any collection ?
Are you looking for just this?
vector<string> var;
http://en.wikipedia.org/wiki/Vector_%28C%2B%2B%29
It's used pretty much the same way but with different method names.
There's std::vector<std::string>
provided by the STL.
Here's the documentation for std::vector
精彩评论