I am trying to write a function to check if we need to resize an array to fit the new values.
please someone explain what should I do with my function
1 2 3 4 5 6
hangeSize should
Dynamically allocate an array of newEls ints.
If newEls >= oldEls:
Copy the oldEls values from the old array
(which ptr points to) to the new array (which we just allocated).
Set the rest of the elements in the new array to 0.
1 2 3 4
Otherwise
Copy newEls values from the old array to the new array.
Deallocate the old array
Make ptr point to the new array