Skip to content
Snippets Groups Projects

add function stack_push

Merged richarda.tyarks requested to merge 5-add-push-function into main
2 unresolved threads
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
+ 2
2
@@ -17,9 +17,9 @@ void stack_destroy(stack *s) {
void stack_push(stack *s, int value)
{
if (s->top == s->capacity-1)
if (s->top == DEFAULT_CAPACITY-1)
{
assert(s->data = realloc(s->capacity * 2 * sizeof(int)));
assert(s->data = realloc(DEFAULT_CAPACITY * 2 * sizeof(int)));
}
s->top++;
Loading