Home CPSC 340

Dynamic Memory Exercise


To be able to use dynamic arrays and memory management in C++.


For this lab, you will write a program that will read in some number of integers from the user and then print them in the reverse order. In order to do this, you will read the values into an array.

The array should be allocated dynamically with new, so that your program will work with any amount of numbers, and not waste memory with unused portions of the array.



When your program works, email the code to ifinlay@umw.edu.

Copyright © 2018 Ian Finlayson | Licensed under a Creative Commons Attribution 4.0 International License.