سلام
من این کد رو برای پساده سازی صف نوشتم اما با خطای زمان اجرا مواجه شدم.
هرچقدر بررسی میکنم اشکالی توی کد نمی بینم، اگر ممکنه شما راهنماییم کنید.
ممنونم

#include "stdafx.h"


#include<iostream>
#include<cstdlib>
#define SIZE 10
using namespace std;
class Queue{
private:
int item[SIZE];
int rear;
int front;
public:
Queue();
void addqueue(int, int&);
int qremove(int&, int&);
int isEmpty();
void print();


};
Queue::Queue(){
rear = -1;
front = 0;
}
int Queue::isEmpty(){
if (rear<front)
return 1;
else
return 0;
}
void Queue::addqueue(int x, int &overflow)
{
if (rear = SIZE - 1){
overflow = 1;
exit(1);
}
else
{
overflow = 0;
item[++rear] = x;
}
}
int Queue::qremove(int &x, int &underflow)
{
if (isEmpty())
underflow = 1;
else{
underflow = 0;
x = item[front++];
return(x);

}
}
void Queue::print(){



cout << "queue: ";

for (int i = front; i <= rear; i++)


cout << item[i] << " ";
cout << "\n";

}








int main(){
int underflow = -1;
int overflow = -1;
int x=0;


Queue Q;
Q.addqueue(3,overflow);
Q.addqueue(7, overflow);
Q.addqueue(11, overflow);
Q.qremove(x, underflow);
Q.print();


return 0;
}