delete() for all structures.

This commit is contained in:
Murilo Soares Pereira
2010-04-08 01:11:10 -03:00
parent ecaa2a4c68
commit 90c7ce6280
5 changed files with 36 additions and 2 deletions
+7 -1
View File
@@ -11,12 +11,18 @@ void allocate_stack(struct stack **stack) {
}
void initialize_stack(struct stack *stack) {
stack->card = NULL;
stack->next = NULL;
return;
}
void delete_stack(struct stack *stack) {
delete_card(stack->card);
free(stack);
return;
}
bool empty(struct stack *stack) {
return(stack->card == NULL);
}