void Team::expandTeam() { if((this->capacity - this->nrOfPlayers)< 2) { this->capacity +5; Player **temp = new Player*[this->capacity]; for(int i = 0; i<this->nrOfPlayers;i++) { temp[i] = this->team[i]; } delete[]this->team; team = temp; } }
Standard input is empty
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; ^
Standard output is empty