请问以下循环队列入队操作是否有错误(当头尾指针相等且tag=0,则队列为空;当头尾指针相等且tag=1,则队列为满)

typedef struct
{ QueueElementType element[MAXSIZE];
int front; /头指针/
int rear ; /尾指针/
} SeqQueue;
int EnterQueue(SeqQueue *Q, QueueElementType x)
{ int tag;
if ( Q->front==Q->rear && tag==1 ) return FALSE;
Q->element[Q->rear]=x;
Q->rear=(Q->rear+1) % MAXSIZE;
return TRUE;
}

首先你的tag没有初始化,其次tag应该写在外面,全局或者是作为参数传进来,写在函数内这个tag每次都会被重置,没有意义,下面的判断也是永远不成立或者永远成立