Dynamic Arrays and DAM

Hey I need a way to check if a Dynamic Array is full. I am writing a check program for class saying once an array is full I have a function that creates a new array (doubled in size) and moves all the elements into it. I was able to create it, but I want to create an if/else statement that tells the program when to call the doubleArray function. Any ideas?
You need to keep the size of the array around, along with how many elements are actually occupied. Then you just compare the two numbers.
so I can say something like, when i = size (where size is the amount of elements in the array) call the doubleArray function? Is it really that simple? haha thanks!
Turn your array into a container? Put it inside a class, alongside a size_t variable that stores its size, and write overloaded operators that let you treat it as a normal array, but automatically check and re-allocate memory if needed (or just use an existing container).
I have no idea what that is... thats why, its only my second semester of programming and it just started.
In that case, never mind. Just stick to the manual size check whenever you use the array.
Topic archived. No new replies allowed.