Advertisement
Mary_99

TestStack

Oct 11th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.51 KB | None | 0 0
  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <stdbool.h>
  5. #include "task1a.h"
  6. #include "task1a.c"
  7.  
  8.  
  9. int main( int argc, char const *argv[])
  10. {
  11.     Stack*s1 = init(SIZE);
  12.     push(s1, 10);
  13.     push(s1, 20);
  14.     push(s1, 30);
  15.     push(s1, 40);
  16.     push(s1, 50);
  17.     printf("Size of the stack: %d\n",s1->size);
  18.     push(s1, 60);
  19.     printf("Size of the stack: %d\n",s1->size);
  20.    
  21.     while(s1->top != -1)
  22.     {
  23.         printf("%d\n", pop(s1));
  24.     }
  25.    
  26.     destroy (s1);
  27.     return 0;
  28.    
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement