C:\Dev-Cpp\Chapter9\orderedArrayListType.cpp: In member function `int orderedArrayListType<elemType>::minLocation(int, int)':
C:\Dev-Cpp\Chapter9\orderedArrayListType.cpp:359: error: missing template arguments before '[' token
C:\Dev-Cpp\Chapter9\orderedArrayListType.cpp:359: error: missing template arguments before '[' token
Execution terminated
#include "arrayListType.h"
template <class elemType>
class orderedArrayListType : public arrayListType<elemType>
{
public:
void insertOrd(const elemType&);
int binarySearch(const elemType& item) const;
void selectionSort();
orderedArrayListType(int size = 100);
//int seqSearch(const elemType& item) const;
//Function to search the list for a given item.
//Postcondition: If the item is found, returns the location
// in the array where the item is found; otherwise,
// returns -1.
private:
void swap(int first, int second);
int minLocation(int first, int last);
};
template<class elemType>
orderedArrayListType<elemType>::orderedArrayListType(int size )
// : arrayListType(size)
{
size = 100;
} //end constructor
template<class elemType>
int orderedArrayListType<elemType>::minLocation(int first, int last)
{
int loc, minIndex;
minIndex = first;
for(loc = first + 1; loc <= last; loc++)
if(list[loc] < list[minIndex])
minIndex = loc;
return minIndex;
} //end minLocation
C:\Dev-Cpp\Chapter9>arrayListType
Line 3: Enter numbers ending with -999
45 67 89 12 3 -999
Line 8: The list before sorting:
45 67 89 12 3
Line 12: The list after sorting:
3 12 45 67 89