Advertisement
Guest User

main.c

a guest
Jan 19th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1. #include "circularBuffer.h"
  2. int main()
  3. {
  4.     struct circularBuffer buff;
  5.     bufferInitialization(&buff, 6);
  6.     addElement(&buff, 9);
  7.     addElement(&buff, 12);
  8.     addElement(&buff, 34);
  9.     addElement(&buff, 62);
  10.     addElement(&buff, 4);
  11.     addElement(&buff, 51);
  12.  
  13.     //unosimo sedmi
  14.     addElement(&buff, 35);
  15.     printBuffer(&buff);
  16.  
  17.     deleteElement(&buff);
  18.     printBuffer(&buff);
  19.  
  20.     deleteElement(&buff);
  21.     deleteElement(&buff);
  22.    
  23.     addElement(&buff, 1);
  24.     addElement(&buff, 2);
  25.     addElement(&buff, 3);
  26.     //unosimo sedmi
  27.     addElement(&buff, 99);
  28.     printBuffer(&buff);
  29.  
  30.     deleteAll(&buff);
  31.     deleteElement(&buff);
  32.     printBuffer(&buff);
  33.    
  34.  
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement