Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void SimpleReg::removeTeam(string name){
- Team *tempList;
- if (teamNo == 0) {
- cout << "Warning! There is no team " << endl;
- return;
- } else if (teamNo == 1){
- delete[]teams;
- teams = NULL;
- teamNo = 0;
- return;
- } else { // more than 1
- if (findTeam(name) == -1){
- cout << "warning! there is no team with the given name " << name << endl;
- }
- else{
- int count = 0;
- tempList = teams;
- teamNo--;
- teams = new Team[teamNo];
- for(int i = 0; i < teamNo+1;i++){
- //compare the names and delete the given name team
- if(!compareTeamNames(tempList[i].getTeamName(), name)){
- teams[count] = tempList[i];
- count++;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement