Not sure why Variables not passing

I've got this sorting program that uses variables from another class but I'm not sure why its not recognizing it. I'm getting an error length and list not declared in this scope.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include "arrayListType.h"

using namespace std;

template<class elemType>
class orderedArrayListType: public arrayListType<elemType>
{
public:
	void selectionSort();

	int binarySearch(const elemType& item) const;

	orderedArrayListType(int size = 100);

private:
	void swap(int first, int second);
	int minLocation(int first, int last);
};


template<class elemType>
void orderedArrayListType<elemType>::selectionSort()
{
	int loc, minIndex;

	for (loc = 0; loc < length; loc++)
	{

		minIndex = minLocation(loc, length - 1);
		swap(loc, minIndex);
	}
}


the variables are declared in here

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef H_arrayListType
#define H_arrayListType

#include <iostream>
#include <cassert>

using namespace std;

template<class elemType>
class arrayListType
{

some functions;

protected:
    elemType *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
};
Last edited on
refer them as this->length and this->list
http://stackoverflow.com/a/5533450
Topic archived. No new replies allowed.