开发者

String array and Arraylist/list in C++

I am new to C++, can anybody provide m开发者_JAVA百科e some sample program's for String array and Arraylist/list in C++

Thanks in Advance.


You can use std::vector<std::string>. it can be accessed like a normal array (i.e. it provides operator[]). See here for the methods provided by vector. You can insert the elements using push_back and access elements either using an iterator or operator[]

[3]: [3]: http://www.cplusplus.com/reference/stl/vector/operator%5B%5D/

[3]: [3]: http://www.cplusplus.com/reference/stl/vector/operator%5B%5D/


You can refer the following urls,

1. String

2. Character Sequence

3. STL

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜