Add return value in deque()

This commit is contained in:
stepfencurryxiao 2020-04-21 18:38:03 +08:00
parent 0cf9b4eb45
commit 22a179f2db

View File

@ -66,7 +66,7 @@ void enque(int x) {
* Takes the next item from the Queue.
*/
int deque() {
int returnData;
int returnData = 0;
if(head == NULL) {
printf("ERROR: Deque from empty queue.\n");
exit(1);
@ -78,6 +78,7 @@ int deque() {
head = head->pre;
head->next = NULL;
}
return returnData;
}
/**