]> git.datanom.net - clib.git/blame_incremental - demo/demo.c
init
[clib.git] / demo / demo.c
... / ...
CommitLineData
1#include <stdio.h>
2#include <stdlib.h>
3#include "queue.h"
4#include "stack.h"
5
6int 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.037651 seconds and 5 git commands to generate.