c++ equivalent to python append method for lists -


i'm learning c++ coming background in python.

i'm wondering there way append items list in c++?

mylist = [] in range(10):     mylist.append(i) 

is there in c++ can array?

you need vector, this:

#include <vector>  void funct() {     std::vector<int> mylist;     for(int = 0; < 10; i++)         mylist.push_back(10); } 

see http://cplusplus.com/reference/stl/vector/ more information.


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -