fork download
  1. void Team::expandTeam()
  2. {
  3. if((this->capacity - this->nrOfPlayers)< 2)
  4. {
  5. this->capacity +5;
  6. Player **temp = new Player*[this->capacity];
  7. for(int i = 0; i<this->nrOfPlayers;i++)
  8. {
  9. temp[i] = this->team[i];
  10. }
  11. delete[]this->team;
  12. team = temp;
  13. }
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:6: error: ‘Team’ has not been declared
 void Team::expandTeam()
      ^
prog.cpp: In function ‘void expandTeam()’:
prog.cpp:3:9: error: invalid use of ‘this’ in non-member function
     if((this->capacity - this->nrOfPlayers)< 2)
         ^
prog.cpp:3:26: error: invalid use of ‘this’ in non-member function
     if((this->capacity - this->nrOfPlayers)< 2)
                          ^
prog.cpp:5:9: error: invalid use of ‘this’ in non-member function
         this->capacity +5;
         ^
prog.cpp:6:9: error: ‘Player’ was not declared in this scope
         Player **temp = new Player*[this->capacity];
         ^
prog.cpp:6:18: error: ‘temp’ was not declared in this scope
         Player **temp = new Player*[this->capacity];
                  ^
prog.cpp:6:29: error: expected type-specifier before ‘Player’
         Player **temp = new Player*[this->capacity];
                             ^
prog.cpp:6:29: error: expected ‘;’ before ‘Player’
prog.cpp:7:26: error: invalid use of ‘this’ in non-member function
         for(int i = 0; i<this->nrOfPlayers;i++)
                          ^
prog.cpp:9:25: error: invalid use of ‘this’ in non-member function
               temp[i] = this->team[i];
                         ^
prog.cpp:11:16: error: invalid use of ‘this’ in non-member function
        delete[]this->team;
                ^
prog.cpp:12:8: error: ‘team’ was not declared in this scope
        team = temp;
        ^
stdout
Standard output is empty