我有一个队列类(取自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;
}
我正在尝试弄清楚编译器为什么告诉我有“head”和“tail”的多个定义,但一直没有成功。
编辑:当编译器给出错误消息时,它会打开一个来自不知道哪里的locale_facets.tcc文件,并说错误在以下函数的第2497行:
bool
__verify_grouping(const char* __grouping, size_t __grouping_size,
const string& __grouping_tmp)
有没有人有任何见解?