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

rename function peek into stack_peek

parent ec3d1f08
No related branches found
No related tags found
1 merge request!5Resolve "Add peek function"
#include <stdio.h> #include <stdio.h>
#include "stack.h" #include "stack.h"
void peek(stack s, int *value){ void stack_peek(stack s, int *value){
if(s.top>-1 && s.top<s.capacity){ if(s.top>-1 && s.top<s.capacity){
*value=s.data[s.top]; *value=s.data[s.top];
} }
......
...@@ -7,6 +7,6 @@ typedef struct _stack { ...@@ -7,6 +7,6 @@ typedef struct _stack {
int top; int top;
} stack; } stack;
void peek(stack s, int *value); void stack_peek(stack s, int *value);
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment