I am not sure what is it that they want me to type there before '['
I get this error message:
1 2 3 4
C:\Dev-Cpp\Chapter2\listType.cpp: In member function `void listType<elemType>::printList()':
C:\Dev-Cpp\Chapter2\listType.cpp:86: error: expected primary-expression before '[' token
Execution terminated
#include<iostream>
#include<cassert>
usingnamespace std;
template <class elemType>
class listType
{
public:
bool isEmpty();
bool isFull();
void search(const elemType& searchItem, bool& found);
void insert(const elemType& newElement);
void remove(const elemType& removeElement);
void destroyList();
void printList();
listType();
private:
elemType list[100]; //array to hold the list elements
int length; //variable to store the number
//of elements in the list
};
template<class elemType>
void listType<elemType>::printList()
{
for(int i = 0; i < length; i++)
cout << listType[i]<<" " ;
cout <<endl;
}