C++ - Practical Two

Vectors and Matrices

Write two classes to implement dynamic vectors and matrices in C++.

Both classes must allocate memory dynamically to allow for variable-sized data structures. Use the malloc/free procedures for this purpose. Make this allocation/deallocation in the constructor/destructor.

The following procedures must be implemented in both classes:

Test your classes thoroughly using all combinations of test data. Also, check for validity of vector/matrix combinations.

Do not implement a user interface. Instead, hard-wire the procedure calls into the main program body.