]> git.datanom.net - clib.git/blob - demo/demo.c
8e5de8c88449080e17a124fbb3eaecd15e91c54c
[clib.git] / demo / demo.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "queue.h"
4 #include "stack.h"
5
6 int main() {
7 /*
8 Stack* stack = stack_init();
9 if (stack_empty(stack))
10 printf("Stack is empty\n");
11
12 int* i = malloc(sizeof(int*));
13 *i = 10;
14 stack_push(stack, i);
15 int* j = malloc(sizeof(int*));
16 *j = 5;
17 stack_push(stack, j);
18 int* val = stack_pop(stack);
19 printf("Stack back: %i\n", *val);
20 free(val);
21 void** elems = stack_clear(&stack);
22 for (int i = 0; elems[i]; i++)
23 free(elems[i]);
24 free(elems);
25 */
26 return 0;
27 }
28
This page took 0.085986 seconds and 6 git commands to generate.