#include <iostream>
using namespace std;
template<typename T>
class myQueue
{
public:
myQueue() : head(0), tail(0), length(0)
{
//memset(a, 0, sizeof(a)); //没有string数组
a = new T[maxn];
}
~myQueue();
void push(const T&);
void pop();
T& front();
int size() const
{
return length;
}
bool empty() const;
bool full() const
{
return (tail + 1) % maxn == head;
}
void destory();
private:
static const int maxn = 255;
int head, tail, length;
......
阅读全文