Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Gang::addBoss(int where) {
- Boss *sup_ptr = new Boss[sizeBoss + 1];
- for (int i = 0; i < sizeBoss + 1; i++) {
- if (i == where) {
- sup_ptr[i].initBoss();
- }
- else if (i > where) {
- sup_ptr[i] = ptrBoss[i - 1];
- }
- else {
- sup_ptr[i] = ptrBoss[i];
- }
- }
- delete[] ptrBoss;
- ptrBoss = sup_ptr;
- ++sizeBoss;
- }
- Gang & Gang ::operator=(const Gang & g) {
- ptrBoss = new Boss;
- ptrBoss = g.ptrBoss;
- return *this;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement