Hello everyone, I'm currently having some problems with this code. I am getting many compiling errors and i was wondering if you guys could help get rid of them.
#pragma once
#define CAPACITY 128;
typedef int QueueElement;
class Queue
{
public:
Queue();
int empty();
void enqueue(const QueueElement & value);
void display();
QueueElement front();
void dequeue();
private:
int myfront, myback, count;
QueueElement myArray[CAPACITY];
};
The QueueElement myArray[CAPACITY]; part gives me these errors:
1>c:\documents and settings\damian sanchez\my documents\visual studio 2005\projects\queue(3)\queue(3)\Queue.h(16) : error C2143: syntax error : missing ')' before ';'
1>c:\documents and settings\damian sanchez\my documents\visual studio 2005\projects\queue(3)\queue(3)\Queue.h(16) : error C2143: syntax error : missing ']' before ')'
1>c:\documents and settings\damian sanchez\my documents\visual studio 2005\projects\queue(3)\queue(3)\Queue.h(16) : error C2143: syntax error : missing ';' before ')'
1>c:\documents and settings\damian sanchez\my documents\visual studio 2005\projects\queue(3)\queue(3)\Queue.h(16) : error C2059: syntax error : ')'
1>c:\documents and settings\damian sanchez\my documents\visual studio 2005\projects\queue(3)\queue(3)\Queue.h(16) : error C2059: syntax error : ']'
1>c:\documents and settings\damian sanchez\my documents\visual studio 2005\projects\queue(3)\queue(3)\Queue.h(16) : error C2238: unexpected token(s) preceding ';'
void Queue::display()
{
for(int i=myfront ; i !=myback ; i=(i++)%CAPACITY)
{
cout<<myArray[i]<<"";
}
cout<<endl;
}
Also, this part above, the for loop gives me this error:
1>.\queue.cpp(33) : error C2059: syntax error : ';'
Thank you in advance for helping me.