I wrote a program to do the following:
Write a destructor to return the dynamic memory used by the list to the heap.
Write a function which returns the number of items in the list.
Write a function which returns true if the list is full.
Write a function to add one item to the list. The argument of the function contains the item to be added.
Write a function to remove all of the items from the list.
Write a function to print the contents of the list to a report.
write a function to display the contents of the list to the display.
i woul like to write a small program in main to test the array list.
using namespace std;
a = new int[max];
if ( a==NULL)
cout<< "Error : Insufficient memory.\n";
int List::length ()
void List::add (int new_item)
cout<<"Enter a new item to the list: "<<endl;
cout<<"Error:adding to a full list."<<endl;
void List::erase ()
i want to add items to the list and test it in main but still I have error message which i do not know why please i need help?