Skip to content
Snippets Groups Projects

Added init function

Merged alec.schmidt requested to merge stack_init into main
1 unresolved thread
Files
2
+ 12
0
#include "stack.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#define DEFAULT_CAPACITY 4
void stack_init(stack *s)
{
s->top = -1;
s->capacity = DEFAULT_CAPACITY;
s->data = malloc(sizeof(int) * DEFAULT_CAPACITY);
}
\ No newline at end of file
Loading