mirror of
https://github.com/TheAlgorithms/C
synced 2024-11-25 06:49:36 +03:00
Add return value in deque()
This commit is contained in:
parent
0cf9b4eb45
commit
22a179f2db
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user