View Single Post
Old 02-20-2006, 01:04 PM   #4 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 745
DJMaze is on a distinguished road
Quote:
Originally Posted by Anakashar
(and I think I see what you're doing, you gotta delete [] array the array before you re-declare it as a different new int[])
That's actualy my point. Your not realy creating a dynamic array since you either need to delete it or copy data from one array into the other and then delete the old one.
So mainly your example is dynamic but not sufficient when you need to resize it after declaration.

So using alloc functions to resize the array you are realy working dynamical without creating memory overhead and without process abuse

I've that path many times before and it bugged me BUT it is a nice newbie example how to create a dynamic array.
DJMaze is offline   Reply With Quote