using namespace std;
Template
The class Queue {
Public: Queue (int size=0);
The Queue (const Queue
Virtual ~ Queue ();
Void In (T, n);
Const T Out ();
Bool Empty () const;
Bool Full () const;
Private: int Max. Front T * and * Tail;
};
Template
Queue
{
Front Tail of==new T [(Max=size) + 1);
}
Template
Queue
{
Front=new T [(Max=q.m ax) + 1);
Tail=Front + (int (q.T ail - q.F ront));
For (int I=0; i
The Front [I]=q.F ront [I];
}
}
Template
Queue
{
The delete [] Front;
}
Template
Const T Queue
{
If (Tail==Front)
{
Cout & lt; <"Overflow" & lt;
}
The else
{
Return * (Front++);//return to the team the element
}
}
Template
Void Queue
{
If (int (Tail - Front) & gt;=Max)
Cout & lt; <"Overflow" & lt;
}
Template
Bool Queue
{
Return the Front==Tail;
}
Template
Bool Queue
{
Return int (Tail - Front)==Max;
}
Int main ()
{
Queue
For (int I=2; i <5; I++)
Queue1. In (I);
For (double I=0; i <8; I++)
Queue2. In (I);
Cout & lt;
}
Finally the output function of entrance Out like the debug to the operation of the Front pointer cannot run normally, bosses, please help to look at
CodePudding user response:
Wrong is a team function