开发者

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

开发者 https://www.devze.com 2023-04-13 09:22 出处:网络
I am using native function开发者_开发百科 in my java class. I have written C++ function for XML parsing.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号