Hey. I'm trying to simply input items into a list, then be able to sort them and do whatever. I've done this before for my previous classes, but we have we have to use class files out of the book and modify them to make this work and I'm having way too much trouble. If somebody could point me in the right direction, it would be much appreciated.
I created the .cpp file. The unsorted.h is from the book. There are a couple of more files, let me know if they are needed.
// This is the .cpp file.
#include "unsorted.h"
#include <iostream>
using namespace std;
int main()
{
UnsortedType list;
ItemType item;
list.MakeEmpty();
item.Initialize();
cout << "Enter number (-999 to quit): ";
cin >> item;
list.InsertItem(item);
}
// This is the unsorted.h file.
#include "itemtype.h"
class UnsortedType
{
public:
UnsortedType();
bool IsFull() const;
int LengthIs() const;
void RetrieveItem(ItemType& item, bool& found);
void InsertItem(ItemType item);
void DeleteItem(ItemType item);
void ResetList();
void MakeEmpty();
void GetNextItem(ItemType& item);
private:
int length;
ItemType info[MAX_ITEM];
int currentPos;
};