im new to this so,
what is the code for dynamic array?
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"
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
>> 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.
Last edited by ILoveVectors; 08-21-2005 at 07:45 PM.