class Sequence {
public:
Sequence ();
~Sequence ();
void initialize (int length = 100);
void ascend ();
void descend ();
void random ();
int * getArray ();
int getLength () const;
private:
int * arr;
int length;
bool initialized;
};
///////////////////////////////////////
#include "sort.h"
Sort::Sort () {}
Sort::~Sort () {}
void Sort::insertion (int * arr, int length, int & steps) const {
int j, temp;
steps += 1;
for (int i = 0; i < length; i++)
/////////////////////////////////////////////////
#ifndef _SORT
#define _SORT
class Sort {
public:
Sort ();
~Sort ();
void insertion (int * arr, int length, int & steps) const;
void selection (int * arr, int length, int & steps) const;
void bubble (int * arr, int length, int & steps) const;
void merge (int * arr, int length, int & steps);
void quick (int * arr, int start, int length, int & steps);
void mergeStep (int * arr, int n1, int n2, int & steps);
int partitionStep (int * arr, int start, int length, int & steps);
void swap (int* val1, int* val2);
private:
};
Which is most likely a logical error. Each cpp-file is supposed to be compiled separately; not included.
The bigger question is: Why do you want?
Transition from one-file into multi-file code organization requires some learning. If you already master the latter, then why do you want to use the former?