Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. resizeEmployees(int newCapacity){
  2. if(newCapacity == employeesCapacity){
  3. employeesCapacity *= 2;
  4. }
  5. Employee* employees2 = new Employee[employeesCapacity];
  6. for (int i = 0; i < employeesCapacity; i++){
  7. employees2[i] = employees[i];
  8. }
  9. delete[] employees;
  10. employees = employees2;
  11. }
  12. resizeEquipment(int newCapacity){
  13. if(newCapacity == equipmentCapacity){
  14. equipmentCapacity *= 2;
  15. }
  16. Equipment* equipment2 = new Equipment[equipmentCapacity];
  17. for (int i = 0; i < equipmentCapacity; i++){
  18. equipment2[i] = equipment[i];
  19. }
  20. delete[] equipment;
  21. equipment = equipment2;
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement