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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -