Advertisement
Monika__

Teststack1a.c

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