Skip to content
Snippets Groups Projects

Resolve "Add peek function"

Merged narindra.rajohnso requested to merge 7-add-peek-function into main
All threads resolved!
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 1
1
@@ -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];
}
}
}
}
Loading