I'm attempting to implement the ADT list by using pointers and my list is just supposed to contain integers but I'm confused on how to create the list in the main function and how to properly use some of the function calls such as insert
here is how i'm attempting to create the list in main, but I keep getting an error saying "request for member 'insert' in 'aList', which is of non member type 'list*'"
#ifndef LIST_H_INCLUDED
#define LIST_H_INCLUDED
/** @file ListAexcept.h */
#include "listExceptions.h"
#include <iostream>
#include <stack>
#include <list>
//const int MAX_LIST = 20;
typedefint ListItemType;
/** @class List
* ADT list - Array-based implementation with exceptions */
class List
{
public:
~List();
List();
// destructor is supplied by compiler
//@param aList the list to copy
List(const List& aList);
/** @throw None. */
bool isEmpty() const;
/** @throw None. */
int getLength() const;
/** @throw ListIndexOutOfRangeException If index < 1 or index >
* getLength() + 1.
* @throw ListException If newItem cannot be placed in the list
* because the array is full. */
void insert(int newEntry);
/** @throw ListIndexOutOfRangeException If index < 1 or index >
* getLength(). */
void remove(int index)
throw(ListIndexOutOfRangeException);
/** @throw ListIndexOutOfRangeException If index < 1 or index >
* getLength(). */
void retrieve(int index, ListItemType& dataItem) constthrow(ListIndexOutOfRangeException);
voidoperator= (const List & rhs);
int largest(List a);
int findLargest(List& a, int start, int end);
//int find(int index) const;
private:
/** array of list items */
//ListItemType item[5];
ListItemType items[1];
// need to change insert and delete parameter to *listPointer
/** number of items in list */
int size;
int *listPointer;
int translate(int index) const;
}; // end List