Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

whait is the mistake in this

–1 vote
asked Mar 26, 2019 by anonymous
#include<iostream>
using namespace std;
class queue;
{
 int front.rear;
 int queue[30];
public:
   queue():front (-1),rear(-1){}
   int isfull()
   {
       if (rear==29)
       return;
       else
       return()
   }
   int isempty()
   {
       if(front==-1)
       return 1;
       else
       return0;
   }
void enqueue(int x)
{
    if(isfull())
    cout<<"\n overflow";
    elseif(front==-1)
    
}
{
    fornt=0;
    rear=0;
}
else
    rear++;
    queue[rear]=x;
}
void dequeue()
{
    if(is empty())
    {
        cout<<"\n underflow";
    }
    elseif (rear==0)
    {
        front=-1;
        rear=-1;
    }
    else
    {
        cout<<"\n deleted node is :"<<queue[rear];
        rear;
    }
    }
    void display()
    {
        for(int i=0;i<=rear;i++)
        {
            cout<<queue[i]<<"\n";
            
        }
    }
};
int main()
{
    queue q1;
    q1.enqueue(10);
    q1.enqueue(9);
    q1.enqueue(8);
    q1.enqueue(7);
    q1.display();
    q1.dequeue();
    q1.display();
    return q;
}

1 Answer

0 votes
answered Apr 1, 2019 by icinnabonass

Something like line 29-33 (I lost count.)

{
    fornt=0;
    rear=0;
}

Other than that I have no idea. 

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and receive answers from other members of the community.
...