cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
dynamic array
dynamic array
Aug 25, 2011 at 5:01am UTC
alishbat
(1)
What is a dynamic array ? how do we resize it and how can we copy all data to the new array, and release the memory for the old array????
Aug 25, 2011 at 5:08am UTC
Athar
(4466)
What is a dynamic array ?
A container that changes its storage capacity automatically as needed.
how do we resize it
and how can we copy all data to the new array
You answered your own question.
copy
operator= or std::copy:
http://www.cplusplus.com/reference/algorithm/copy/
release the memory for the old array
delete[]
Also:
http://www.cplusplus.com/reference/stl/vector/
Topic archived. No new replies allowed.