SHWOO 25 Junior Poster in Training

The assignment is to write a C++ function using "pointer notation" that will write out the elements of an array of int in reverse order.

The problem I'm having is with the sortAscend function and what the parameters should be to accept an array. I'm getting an error cause I'm passing an object and the function expects an int pointer.

class arrayList
{
public:
    void print() const;
        //Function to output the elements of the list
        //Postcondition: Elements of the list are output
        //                 on the standard output device.

    void sortAscend(int *list, int length);
        //Function to sort the array in Ascending order
        //Postcondition: Elements of the list are sorted 
        //                 in Ascending order

    void insertEnd(int insert);
        //Function to insert elements at the end of list
        //Postcondition: list[length] = insert; length++;

    arrayList(int size = 10);
        //constructor
        //Creates an array of the size specified by the
        //parameter size. The default size is 10.
        //Postcondition: The list points to the array,
        //                 length = 0, and maxSize = size;

    ~arrayList();
        //destructor
        //Deallocate the memory occupied by the array.

private:
    int *list;        //array to hold the list elements
    int length;        //variable to store the length of the list
    int maxSize;    //variable to store the maximum size of the list
};
#include "arrayList.h"

using namespace std;

void arrayList::print() const
{
    for (int i = 0; i < length; i++)
        cout << list[i] << " ";
    cout << endl;
} //end print function

void arrayList::sortAscend(int *list, int length)
{
    for(int i = 0; i …