By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,640 Members | 2,167 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,640 IT Pros & Developers. It's quick & easy.

unqualified id before delete which i use as function what's the error

P: 1
#include<iostream>
using namespace std;
int queue1[5];
int rear= -1, front= -1;

void insert(int x)
{
if(rear>=4)
{
cout<<"queue overflow";
return;
}
queue1[++rear]=x;
cout<<"value inserted"<<x;
}

void delete(int x)

{
if(front==rear)
{
cout<<"queue is underflow";
//return;
}
cout<<"deleted item "<<queue[++front];

}
void display()
{
if(rear==front)
{
cout<<"queue is empty";
return
}
int queue1[5];
int rear= -1, front= -1;
}
int main()
{


int choice;
while(1)
{
cout<<"press 1.enqueu,press 2.dequeu,press 3.display,";
cin>>choice;
switch(choice)
{
case 1: cout<<"enter the element";
cin>>choice;
insert(choice);
break;
case 2:delete();
break;
case 3:display();
break;

}
}
}
Nov 24 '15 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
The word delete is part of the C++ language. You can't use it for a function name.
Nov 24 '15 #2

Post your reply

Sign in to post your reply or Sign up for a free account.