You need to separate the definition (in Quash.h
) from the implementation (in Quash.cpp
)
Quash.h
#ifndef QUASH_H_
#define QUASH_H_ // protect against multiple include
class Quash
{
Quash(); // constructor, declare only the prototype
// similarly for the rest of the methods
};
#endif
Quash.cpp
#include "Quash.h"
#include "Hashtable.h"
#include "Minheap.h"
// DO NOT redefine your class here, only implement its methods
Quash::Quash()
{
// now implement the constructor
heap = new Minheap();
hash = new Hashtable();
};
Quash::~Quash()
{
// and the destructor
delete heap;
delete hash;
}
// do the same for the rest of the methods
And, in main.cpp
, #include "Quash.h"