Dynamic memory: copyArray().
Add resizeArray().
Basic logic structure in main().
Fix errors.
Fix potential leak problems.