loc( sizeof( TCARNODE ) ); //分配头结点空间Р if(!lpCarQueue->lpHead) exit(OVERFLOW); //分配储存失败Р lpCarQueue->lpHead->lpNext = NULL; Р lpCarQueue->nEffSize = 0;Р return OK;Р}Р// 车辆信息 carinfo 入队 lpCarQueueРint EnQueue( LPTCARQUEUE &lpCarQueue, TCARINFOR carinfo )Р{//插入元素carinfo为队lpCarQueue的新的队尾元素Р LPTCARNODE lpCarNode = ( LPTCARNODE ) Рmalloc( sizeof( carnode ) ); //分配结点空间Р if(!lpCarNode) exit(OVERFLOW); //分配储存失败Р lpCarNode->carinfo = carinfo;Р lpCarNode->lpNext = NULL;Р lpCarQueue->lpRear->lpNext = lpCarNode;Р lpCarQueue->lpRear = lpCarNode;Р lpCarQueue->nEffSize++;Р return OK;Р}Р// 队头元素从链队 lpCarQueue 中出队并存入 carinfoРint DeQueue( LPTCARQUEUE &lpCarQueue, TCARINFOR &carinfo )Р{Р if(lpCarQueue->lpHead==lpCarQueue->lpRear) return ERROR; Р//队列里没有元素,返回ERRORР LPTCARNODE lpTemp = lpCarQueue->lpHead->lpNext;