I have the following queue class (taken from wordpress):
#include<iostream.h>
class Queue
{
private:
int data;
Queue*next;
public:
void Enque(int);
int Deque();
}*head,*tail;
void Queue::enque(int data)
{
Queue *temp;
temp=new Queue;
temp->data=data;
temp->next=NULL;
if(heads==NULL)
heads=temp;
else
tail->next=temp;
tail=temp;
}
int Queue::deque()
{
Queue* temp;
temp=heads;
heads=heads->next;
return temp->data;
}
I am trying to understand why the compiler tells me that I have a multiple definition of "head" and "tail" - without success.
edit: When the compiler issues an error message, it opens the locale_facets.tcc file from I-don-t-know-where and says that the error is on line 2497 in the following function:
bool
__verify_grouping(const char* __grouping, size_t __grouping_size,
const string& __grouping_tmp)
Does anyone have any ideas?
Meir source
share