Sign in

gwj / po_oopc · Files

GitLab

  • Go to dashboard
  • Project
  • Activity
  • Files
  • Commits
  • Network
  • Graphs
  • po_oopc
  • examples01-pl
  • 18-stack3
  • teststack.c
  • Reformatted code
    c0b14c54
    Grzegorz Jabłoński authored
    2022-09-16 14:36:36 +0200  
    Browse Code »
teststack.c 335 Bytes
Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include "stack.h"
#include <stdio.h>

int main()
{
    struct stack_handle* s1 = init();
    struct stack_handle* s2 = init();
    push(s1, 1);
    push(s1, 2);
    push(s1, 3);
    push(s2, 5);
    push(s2, 6);
    printf("%d %d\n", pop(s1), pop(s2));
    printf("%d\n", pop(s1));
    finalize(s1);
    finalize(s2);
    return 0;
}