So I have a "base" class called "SortData". When I try to allow my other header file "InsertionSort.h" inherit this base class, I keep getting a class type redefinition error. What am I doing wrong?
Here's the base class header:
// SortData.h
#include <iostream>
using namespace std;
class SortData
{
public:
SortData(int max=100);
~SortData(void);
int size() const;
void randomize(int seed = 1);
void printSome(const int num=10) const;
virtual _int64 sort() = 0;
protected:
long *theData;
int maxSize;
};
And here's the header that's trying to inherit this base class:
// InsertionSort.h
#include "SortData.h"
class InsertionSort : public SortData
{
public:
InsertionSort(int max=100);
~InsertionSort(void);
_int64 sort();
private:
_int64 numops;
void insertionSort(long theArray[], int n);
};