Is anybody know how to create a 3 dimentional dynamic array without using new and malloc? This array should grow automatically when we add an item.
Thanks,
Alextrons
Is anybody know how to create a 3 dimentional dynamic array without using new and malloc? This array should grow automatically when we add an item.
Thanks,
Alextrons
If they can, why can't I...
if you want it to shrink and grow automatically you will have to use malloc or new.
Quidquid latine dictum sit, altum sonatur.
Whatever is said in Latin sounds profound.
No! I found already what I really want and this is the link:
http://www.codeproject.com/cpp/extcol.asp#xx29237xx
however, I don't think it will run in Windows9x.
malloc and new are good only for known size of array.
fyi,
Alextrons
If they can, why can't I...
While the solution is probably better suited to your needs, you should be aware, that without some method of memory allocation at runtime ( new, malloc, calloc, realloc ), dynamically growing data is impossible to manage. At the moment, you still use new. You just don't notice, because it is wrapped in one more layer of classes.
>malloc and new are good only for known size of array
new needs a variable with a set value. But you know the size at runtime. It starts at zero, and every time you add one, you have one element more.
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.
So meaning all dynamic class array ex. CArray, CObArray, etc. are probably created using new, malloc, calloc, & realloc and probably the one who created it is expert using it?
Thanks for the info,
Alextrons
If they can, why can't I...