// Implementing queue using array:
#include<bits/stdc++.h>
using namespace std;
class queue{
public:
int size;
int f;
int r;
int *arr;
};
int isFull(queue *q)
{
if(q->r==q->size-1)
{
return 1;
}
else{
return 0;
}
}
int enqueue(queue* q, int val){
if(isFull(q))
{
cout<<"Overflow Condition";
}
else{
// q->
cout<<"hi";
}
}
int main()
{
queue *q = new queue();
q->f=q->r=-1;
q->size=10;
q->arr= new int[q->size];
}
I was trying to implement queue using array. But if I declare a class 'queue' it is showing error on the other hand when I used uppercase Q 'Queue' the program ran successfully. Can you explain why?