Hello sorry i know i alreadyposted this but i left out my teamList code that will beneeded….
teamList code:
//————————————————————————-
// TeamList.cpp
//
//————————————————————————-
#include <iostream>
#include <string>
using namespace std;
class teamlist{
Team* head;
Team* tail;
int noOfTeams;
public:
teamlist()
{
head=NULL;
tail=NULL;
noOfTeams=0;
}
//————————————————————————-
// addTeam
//————————————————————————-
void addTeam(Team *t){
Team *team=new team(t);
if(head==NULL){
head=team;
tail=team;
}
else{
tail->next=team;
tail=tail->next;
}
noOfTeams++;
}
//————————————————————————-
// readData
//————————————————————————-
void readData(char* filename)
{
ifstream inFile;
inFile.open(filename);
while(!inFile.eof())
{
noOfTeams++;
string id,name,coach;
inFile.getline(cin,id);
inFile.getline(cin,name);
inFile.getline(cin,coach);
Team->newteam=new Team();
newteam.setTeamId(id);
newteam.setName(name);
newteam.setCoach(coach);
if(head==NULL)
{
head=newteam;
tail=newteam;
}
else
{
tail->next=newteam;
tail=tail->next;
}
}
}
//————————————————————————-
// printTeams
//————————————————————————-
void printTeams()
{
Team* temp=head;
while(temp!=NULL)
{
cout<< temp->teamId << endl <<temp->name <<endl << temp->coach <<endl;
temp=temp->next;
}
}
//————————————————————————-
// addTeam
//————————————————————————-
Team* getTeamRef(string id)
{
Team* temp=head;
while(temp!=NULL)
{
if(id.compare(temp->teamId)==0) return temp;
temp=temp->next;
}
return NULL;
}
int getNumTeams()
{
return noOfTeams;
}
};
game: game objects will be part of a linked list (gameList) and will also point