Okay the errors occur in town.h when I try to declare the arrays of type policeman and type teatotaller. I have the .h and .cpp files for the police and for the teatotallers and the .h for the town. If you need to see any of the other files let me know. the errors are z:\cs53\hw10\town.h(54) : error C2148: total size of array must not exceed 0x7fffffff bytes z:\cs53\hw10\town.h(54) : error C2079: 'town::m_police' uses undefined class 'policeman' z:\cs53\hw10\town.h(55) : error C2148: total size of array must not exceed 0x7fffffff bytes z:\cs53\hw10\town.h(55) : error C2079: 'town::m_TTs' uses undefined class 'teatotaller' The files are: //Programmer: CHELSEA SANDERS //Date: 11/20/08 //File: policeman.h //Class: CS 53 A //Purpose: Class of policeman header file. #ifndef POLICEMAN_H #define POLICEMAN_H #include #include using namespace std; //Description: The constructor sets the values based on what is passed to it. //Pre: None //Post: Changes the name, drunk, and doughnut of the policeman. //Description: The >> operator inputs the information of the policeman. //Pre: none. //Post: changes the values of the policeman. //Description: The << operator outputs the information of the policeman. //Pre: none. //Post: Outputs statement to screen. //Description: The drunkEncounter function add one to the m_drunk. //Pre: None. //Post: Changes the value of the m_drunk. //Description: The doughnutTime function determines if the police stays // or goes and gets a doughnut. //Pre: None. //Post: Returns true if police leaves, false if they stay. class policeman { public: friend istream& operator >> (istream& in, policeman& newPolice); friend ostream& operator << (ostream& o, const policeman police); void drunkEncounter(); bool doughnutTime(); private: char m_Lname[NAME_SIZE]; char m_Fname[NAME_SIZE]; int m_drunks; double m_doughnut; }; #endif //Programmer: CHELSEA SANDERS //Date: 11/20/08 //File: policeman.cpp //Class: CS 53 A //Purpose: Class of policeman implmentation file. #include "drunk.h" #include "policeman.h" //Description: The >> operator inputs the information of the policeman. istream& operator >> (istream& in, policeman& newPolice) { char last_name[NAME_SIZE]; in>>last_name; last_name[strlen(last_name)-1]= '\0'; //trims comma off last name strcpy(newPolice.m_Lname,last_name); in>>newPolice.m_Fname; in>>newPolice.m_doughnut; newPolice.m_drunks = 0; return in; } //Description: The << operator outputs the name of the policeman. ostream& operator << (ostream& o, const policeman police) { o << "Policeman, " << police.m_Fname << " " << police.m_Lname << ", has encountered " << police.m_drunks << "."; return o; } //Description: The drunkEncounter function add one to the m_drunk. void policeman::drunkEncounter() { m_drunks++; return; } //Description: The doughnutTime function determines if the police stays // or goes and gets a doughnut. bool policeman::doughnutTime() { bool doughnutTime = true; float prob = m_doughnut * m_drunks; if ((rand()%100)/100.0 < prob) doughnutTime = false; return doughnutTime; } //Programmer: CHELSEA SANDERS //Date: 11/20/08 //File: teatotaller.h //Class: CS 53 A //Purpose: Class of teatotallers header file. #ifndef TEATOTALLER_H #define TEATOTALLER_H #include #include using namespace std; //Description: The >> operator inputs the name and annoyance of a TT. //Pre: None. //Post: Changes the name and annoyance of the TT. //Description: The << operator outputs the name and annoyance of the teatotaller. //Pre: none. //Post: Outputs statement to screen. //Description: The tolerance function returns a bool whether or not the TT has // tolerance for the drunk's bac level. //Pre: None. //Post: Returns true if the TT was annoyed by the drunk, false if not. class teatotaller { public: friend istream& operator >> (istream& in, teatotaller& newTT); friend ostream& operator << (ostream & o, const teatotaller T); bool tolerance(double bac); private: char m_Lname[NAME_SIZE]; char m_Fname[NAME_SIZE]; double m_tolerance; }; #endif //Programmer: CHELSEA SANDERS //Date: 11/20/08 //File: teatotaller.cpp //Class: CS 53 A //Purpose: Class of teatotallers implmentation file. #include "drunk.h" #include "teatotaller.h" //Description: The >> operator inputs the name and annoyance of a TT. istream& operator >> (istream& in, teatotaller& newTT) { char last_name[NAME_SIZE]; in>>last_name; last_name[strlen(last_name)-1]= '\0'; //trims comma off last name strcpy(newTT.m_Lname,last_name); in>>newTT.m_Fname; in>>newTT.m_tolerance; return in; } //Description: The << operator outputs the name of the teatotaller. ostream& operator << (ostream & o, const teatotaller T) { o << "Teatotaller, " << T.m_Fname << " " << T.m_Lname << ", has a tolerance level of " << T.m_tolerance << "."; return o; } //Description: The tolerance function returns a bool whether or not the TT has // tolerance for the drunk's bac level. bool teatotaller::tolerance(double bac) { bool tolerant = false; if (m_tolerance > bac) { tolerant = true; m_tolerance = m_tolerance - bac; } return tolerant; } //Programmer: CHELSEA SANDERS //Date: 11/20/08 //File: town.h //Class: CS 53 A //Purpose: Class of town object's header. #ifndef TOWN_H #define TOWN_H #include #include using namespace std; class drunk; class bar; class policeman; class teatotaller; const int CAPACITY = 7; //Description: Readin Drunks reads in the values for the drunk. //Pre: None. //Post: Changes the values of the drunks. //Description: Constructor sets the town using a bar. //Pre: None. //Post: Changes the valuse of the town. //Description: Quitting time calls the happy hour function. //Pre: None. //Post: call the happy hour function. //Description: to the streets function calls the close bar function. //Pre: None. //Post: calls the close bar function. //Description: display town, displays the drunks in the town. //Pre: None. //Post: uses the << operator for drunks and output to the screen. class town { public: void readinDrunks(); void readinPolice(); void readinTTs(); town(bar new_bar); void quitting_time(const int CAPACITY); void to_the_streets(); void display_town(); void operation_street_sweeper(); void displayDamage(); private: drunk m_drunks[MAX_SIZE]; policeman m_police[MAX_SIZE]; teatotaller m_TTs[MAX_SIZE]; int m_drunks_in_town; int m_numPolice; int m_numTTs; bar m_bar; int m_streetlight; int m_car; int m_building; }; #endif