Extra Credit Lab
dynamic memory management
Note that this assignment is 99% intended to give people that are behind and chance to catch up.
High-level
You will create a class that represents a list of ints that automatically expands. This assignment has the following pieces:
•header file for IntList (provided - IntList.h)
•driver code to test IntList (provided - main.cc)
•makefile to make it easier to compile (provided, but you have to edit it - Makefile)
•Implementation file for IntList (this is your job)
As a first step, make your implementation file (IntList.cc or whatever you want to call it). Then edit the makefile - you might not have g++ on your system so change that to CC if that’s what’s available. Also, if you named the files differently, make sure to change the filenames in the makefile.
Class details
The IntList class should work basically like an array, but without defining the size of the array. Scour the header file to see what functions you should have and what fields are available to you. Also read through the main.cc file to see how it’s used. I’ve also included the output of that on my implementation so you can see how I want it implemented.
You should be able to access the array using indexes from the front (positive numbers) or from the back (negative numbers). In the case of accessing from the back, -1 is the index of the last element, -2 second to last, etc.
I've implemented it and you can download what the output looks like for that
here.