im new to this so,
what is the code for dynamic array?
Printable View
im new to this so,
what is the code for dynamic array?
See this?
User CP FAQ Members List Calendar Search New Posts Mark Forums Read Open Buddy List Log Out
Good, now click the "search", and type in "dynamic array"
>> what is the code for dynamic array?
In C++, you use a vector for dynamic arrays.
what the code for a vector?
*** sorry just anticipating his next question.
edit
bah i might as well answer it then.
make sure to include
#include <vector>
a couple types of vector would be
vector<int>
vector<string> //require string header
you can also create your own types for it.
to add element to a vector you can do
vector<string> vecOFstrings;
vecOFstrings.push_back("this is a string"); //you can also push_back by a variable
there are many things you can do just do a search on vectors,
you can also use iterators they help you from going out
of the array ( vectors ) bounds.