Skip to content
Snippets Groups Projects
Commit 32181909 authored by narindra.rajohnso's avatar narindra.rajohnso
Browse files

Changement de la condition

parent c32b154f
No related branches found
No related tags found
1 merge request!5Resolve "Add peek function"
This commit is part of merge request !5. Comments created here will be created in the context of that merge request.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#include "stack.h" #include "stack.h"
void stack_peek(stack s, int *value){ void stack_peek(stack s, int *value){
if(s.top>-1 && s.top<s.capacity){ if(stack_is_empty(s)){
*value=s.data[s.top]; *value=s.data[s.top];
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment