anirudha mundada
anirudha mundada

Reputation: 596

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 ?

Upvotes: 2

Views: 492

Answers (2)

user47322
user47322

Reputation:

There's std::vector<std::string> provided by the STL.

Here's the documentation for std::vector

Upvotes: 1

Mysticial
Mysticial

Reputation: 471229

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.

Upvotes: 2

Related Questions