# 学习了队列的有关知识,队列,先进先出,FIFO,有顺序队列和环形队列,现在贴出自己使用c++编写的环形队列的代码,记录并分享
//文件名称:MyQueue.h
#ifndef MYQUEUE_H
#define MYQUEUE_H
/***************************************/
/* 类名称:MyQueue
/* 类内容:声明环形队列类的数据成员和成员函数
/***************************************/
class MyQueue
{
public:
MyQueue(int capacity);//声明构造函数
virtual ~MyQueue();//声明析构函数
bool isEmpty();//判断队列是否为空
bool isFull();//判断队列是否为满
void inQueue(int element);//队列元素入队
void outQueue();//队列元素出队
void clearQueue();//清空队列元素
void showQueue();//打印队列元素
private:
int* m_pQueue;