From 22a179f2db4999dfb040fb396103403625188a06 Mon Sep 17 00:00:00 2001 From: stepfencurryxiao Date: Tue, 21 Apr 2020 18:38:03 +0800 Subject: [PATCH] Add return value in deque() --- data_structures/queue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data_structures/queue.c b/data_structures/queue.c index 828d3f7a..df4d91f9 100644 --- a/data_structures/queue.c +++ b/data_structures/queue.c @@ -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; } /**