hello im working on a program that is quite difficult for me and i need some help going in the right direction.. ill post the directions, the driver test program..what i have so far.. thanks!! ... feel free to revise ..
Code:
#ifndef QUEUE_H
#define QUEUE_H
#include <iostream>
#include <stdexcept>
using std::ostream;
using std::out_of_range;
template <class T>
struct QNode
{
QNode(const T & X)
T storeitem;
T * next;
};
QNode::QNode(const T & x)
{
x = QNode;
next = '\0';
}
template <class T>
class Queue
{
private:
T qfront;
T qrear;
public:
Queue(); //default constructor
~Queue(); // destructor
Queue(const Queue& s); //copy constructor
Queue& operator=(const Queue& rightOp);
friend ostream& operator<< <>(ostream&, const Queue<T>&);
void clear();
int size();
bool empty();
bool front();
bool back();
void push();
void pop();
};
template <class T>
Queue<T>::Queue()
{
qfront = '\0';
qrear = '\0';
}
template <class T>
Queue<T>::~Queue()
{
clear();
}
template <class T>
Queue<T>::Queue(const Queue& s)
{
qront = '\0';
qrear = '\0\';
}
Attachments
Last edited by a moderator: