Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

37 строки
577 B

  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <stdio.h>
  3. #include "bucket_allocator.hpp"
  4. int main(int argc, char* argv[]) {
  5. Bucket_Allocator<int, 3> ba;
  6. int* a = ba.allocate();
  7. *a = 1;
  8. printf("%d\n", *a);
  9. ba.free(a);
  10. int* b = ba.allocate();
  11. *b = 2;
  12. printf("%d\n", *b);
  13. int* c = ba.allocate();
  14. *c = 3;
  15. printf("%d\n", *c);
  16. int* d = ba.allocate();
  17. *d = 4;
  18. printf("%d\n", *d);
  19. int* e = ba.allocate();
  20. *e = 5;
  21. printf("%d\n", *e);
  22. int* f = ba.allocate();
  23. *f = 6;
  24. printf("%d\n", *f);
  25. return 0;
  26. }