Skip to content
Snippets Groups Projects

Resolve "Add pop function"

Merged ines.maya requested to merge 6-add-pop-function into main
2 unresolved threads
2 files
+ 7
14
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 6
8
@@ -2,18 +2,16 @@
int main(){
stack s;
int value = 0;
int value = 13;
stack_init(&s);
for (int i = 0; i < s.capacity; i++){
s.top += 1;
s.data[s.top] = i;
printf("push : %d\n", s.data[s.top]);
}
s.top += 1;
s.data[s.top] = value;
s.top += 1;
s.data[s.top] = value+1;
// stack_is_empty(stack s)
stack_pop(&s, &value);
stack_peek(s, &value);
free(s.data);
s.data = NULL;
Loading