Homework 3B, Dynamic 2D Array Class.

Short Description:

Update your static array class to use dynamic memory.

Goals

When you finish this homework, you should have:

Formal Description

Change your static 2D array from homework 3A to a class that uses dynamic memory. You should support everything from homework 3a with the following changes. To accomplish this task, you will need to implement a 2d array inside of a 1d array. This is not difficult and we will discuss this in class. However, the key formula is A2d[r,c] = A1d[r×columns + c]. This is a key concept that you will need in the future.

I would implement an index function that takes the 2d indexes and returns the valid 1d index. This should be a private member function.

All conditions from the previous assignment apply.

Your library should free all memory allocated. Running this program with valgrind should report " All heap blocks were freed -- no leaks are possible".

Required Files

Turn in a single zip or tar file containing all files required to build this project, including a Makefile and a test driver.

Submission

Submit the assignment to the D2L folder Homework 3B by the due date.