Splitting it up in a cpp / h combo is not that bad. You basically just want the class information to go in the header and the implementation in the cpp. Also you might want to make your Display function a method of the class rather then a standard function that takes the class as a param. Here is a simple class split into an h / cpp combo.
Point.h
Code:
#ifndef POINT_H // inclusion guard
#define POINT_H
class Point
{
private:
int m_x, m_y;
public:
// Default constructor
Point( ) : m_x(0), m_y(0) { }
// Overloaded constructor
Point( int x, int y ) : m_x(x), m_y(y) { }
// Set methods
void SetX( int x );
void SetY( int y );
// Get methods
int GetX( void ) const;
int GetY( void ) const;
};
Point.cpp
Code:
#include "Point.h"
void Point::SetX( int x )
{
m_x = x;
}
void Point::SetY( int y )
{
m_y = y;
}
int Point::GetX( void ) const
{
return m_x;
}
int Point::GetY( void ) const
{
return m_y;
}
Don't worry about the point details but that should give you an idea how to split it up. Normally you would want the Get and Set methods to e in the class and not the cpp because they are one liners but I just wanted to show you how you would put them in their own cpp.
As for the different sorting. Just have an enumeration with all the different ways the class can be sorted and store that in the class. Then make a method to set the sort method and retrieve the current method of sorting.
If you need any more help let me know.