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
Help creating function
Help creating function
Sep 1, 2016 at 3:08am UTC
cgm0826
(5)
i need to write a function which doubles the size of a dynamic array of string. The existing array may have data. In this case, i need to be sure to copy the data to the new array. any hints?
Sep 1, 2016 at 5:31am UTC
integralfx
(897)
This is how you could copy
oldArr
to
newArr
.
1
2
3
for
(
int
i = 0; i < oldArrSize; i++ ) { newArr[i] = oldArr[i]; }
Sep 1, 2016 at 6:34am UTC
cgm0826
(5)
Thanks. Now to double a dynamic array is my next step.
Topic archived. No new replies allowed.