title: Array Based List - error in dynamic array creation
body: <p>So I have an assignment from my computer science professor to create an array based list on a user defined data type.</p>
  
  <p>The error I'm getting is this:</p>
  
  <pre><code>In file included from Main.cpp:7:0:
  AddressBook.h: In constructor ‘addressBookType::addressBookType(int)’:
  AddressBook.h:54:37: error: no matching function for call to ‘extPersonType::extPersonType()’
       list = new extPersonType[maxSize];
                                       ^
  </code></pre>
  
  <p>I made a code similar to this in lab, and it worked fine when dynamically creating an array.</p>
  
  <p>Here is my main.cpp file:</p>
  
  <pre><code>// Name: Tristan Raine
  // COSC 2437.002
  // Assignment 3
  // This program tests an array based list
  #include &lt;iostream&gt;
  #include "ExtPerson.h"
  #include "AddressBook.h"
  
  int main()
  {
      cout &lt;&lt; endl; 
  
      addressBookType OnlineAddressBook(3);
  
      extPersonType object1("Family", "361-421-3845", "7824 Yorktown Blvd.", "Corpus Christi", "Texas", "79234", "Tim",
      "Smith", 12, "December", 2025);
  
      extPersonType object2("Friend", "361-523-7531", "7842 Beaver Ln", "Dallas", "Texas", "78541", "John",
      "Deer", 9, "September", 2018);
  
      extPersonType object3("Business Associate", "361-454-2343", "3853 Lucky Rd.", "Las Vegas", "California", "94313", "Jack",
      "Ryan", 23, "March", 2005);
  
      extPersonType object4("Family", "361-432-9764", "6525 Rabbit St.", "Denver", "Colorado", "54231", "Vanessa",
      "Daniels", 03, "March", 2011);
  
      OnlineAddressBook.insert(object1);
      OnlineAddressBook.insert(object2);
      OnlineAddressBook.insert(object3);
      OnlineAddressBook.insert(object4);
  
      OnlineAddressBook.printArray();
  }
  </code></pre>
  
  <p>Here is my AddressBook.h with the functions based on creating an array based list:</p>
  
  <pre><code>#ifndef ADDRESSBOOK_H
  #define ADDRESSBOOK_H
  #include &lt;iostream&gt;
  #include &lt;cassert&gt;
  #include "ExtPerson.h"
  using namespace std;
  
  class addressBookType
  {
      public:
          int seqSearch(extPersonType&amp; item);
          void insert(extPersonType&amp; insertItem);
          void printArray() const;
          void removeAt(int location);
          addressBookType(int size = 100);
          ~addressBookType();
      protected:
          extPersonType *list;
          int length;
          int maxSize;
  };
  
  int addressBookType::seqSearch( extPersonType&amp; item) 
  {
      int loc;
      bool found = false;
      for (loc = 0; loc &lt; length; loc++)
          if (list[loc].getPhone() == item.getPhone() &amp;&amp; list[loc].getIdentity() == item.getIdentity() &amp;&amp; 
          list[loc].getFirstName() == item.getFirstName() &amp;&amp; list[loc].getLastName() == item.getLastName() &amp;&amp; 
          list[loc].getDay() == item.getDay() &amp;&amp; list[loc].getMonth() == item.getMonth() &amp;&amp; list[loc].getYear() == item.getYear() &amp;&amp;
          list[loc].getStreet() == item.getStreet() &amp;&amp; list[loc].getCity() == item.getCity() &amp;&amp; list[loc].getState() == item.getState() &amp;&amp;
          list[loc].getZipcode() == item.getZipcode())
          {
              found = true;
              break;
          }
      if (found)
          return loc;
      else
          return -1;
  }
  
  addressBookType::addressBookType(int size)
  {
      if (size &lt;= 0)
      {
          cerr &lt;&lt; "The array size must be positive. Creating "
          &lt;&lt; "an array of size 100. " &lt;&lt; endl;
          maxSize = 100;
      }
      else
          maxSize = size;
      length = 0;
      list = new extPersonType[maxSize];
      assert(list != NULL);
  }
  
  addressBookType::~addressBookType()
  {
      delete [] list;
  }
  
  void addressBookType::insert(extPersonType&amp; insertItem)
  {
      int loc;
      if (length == 0) //list is empty
          list[length++] = insertItem; //insert the item and
      //increment the length
      else if (length == maxSize)
          cerr &lt;&lt; "Cannot insert in a full list." &lt;&lt; endl;
      else
      {
          loc = seqSearch(insertItem);
          if (loc == -1) //the item to be inserted
              //does not exist in the list
              list[length++] = insertItem;
          else
              cerr &lt;&lt; "the item to be inserted is already in "
              &lt;&lt; "the list. No duplicates are allowed." &lt;&lt; endl;
      }
  }
  
  void addressBookType::removeAt(int location)
  {
      if(location &lt; 0 || location &gt;= length)
          cout &lt;&lt; "The location of the item to be removed is out of range" &lt;&lt; endl;
      else
      {
          for(int i = location; i &lt; length - 1; i++)
              list[i] = list[i+1];
          length--;
      }
  
  }
  
  void addressBookType::printArray() const
  {
      for (int i = 0; i &lt; length; i++)
      {
          list[i].print();
      }
      cout &lt;&lt; endl;
  
  }
  
  #endif
  </code></pre>
  
  <p>Here is my ExtPerson.h file:</p>
  
  <pre><code>// Header file for extPersonType class which has its' function prototypes and variables
  #ifndef EXTPERSON_H
  #define EXTPERSON_H
  #include &lt;string&gt;
  #include "Address.h"
  #include "Person.h"
  #include "Data.h"
  using namespace std;
  
  // extPersonType is derived from all of these classes
  class extPersonType: public addressType, public personType, public dataType
  {
      private:
          string phone;
          string ident;
          int *ptr;
      public:
          // Constructor, inline member function
          extPersonType(string i, string ph, string s, string c, string st, string z, string fn,
          string ln, int d, string m, int y) : addressType(s, c, st, z), personType(fn, ln), dataType(d, m, y)
          {
              phone = ph;
              ident = i;
          }
  
          // setPhone function prototype
          void setPhone(string ph);
  
          // setIdentity function prototype
          void setIdentity(string i);
  
          // print function prototype
          void print();
  
          // getPhone function prototype
          string getPhone()
          {
              return phone;
          }
  
          // getIdentity function prototype
          string getIdentity()
          {
              return ident;
          }
  
          // Assign function
          void operator=(extPersonType &amp;right)
          {
              phone = right.phone;
              ident = right.ident;
              firstname = right.firstname;
              lastname = right.lastname;
              street = right.street;
              city = right.city;
              state = right.state;
              zipcode = right.zipcode;
              month = right.month;
              day = right.day;
              year = right.year;
          }
  
          // Checks if objects are equal
          bool operator==(extPersonType &amp;right)
          {
              return(phone == right.phone &amp;&amp; ident == right.ident &amp;&amp; firstname == right.firstname &amp;&amp; lastname == right.lastname
              &amp;&amp; street == right.street &amp;&amp; city == right.city &amp;&amp; state == right.state &amp;&amp; zipcode == right.zipcode &amp;&amp;
              month == right.month &amp;&amp; day == right.day &amp;&amp; year == right.year);
          }
  
          // Copy constructor
          extPersonType (const extPersonType &amp;obj) : addressType(obj), personType(obj), dataType(obj)
          {
              cout &lt;&lt; "Copy constructor active." &lt;&lt; endl;
              phone = obj.phone;
              ident = obj.ident;
          }
  };
  
  #endif
  </code></pre>
  
  <p>Here is my ExtPerson.cpp file:</p>
  
  <pre><code>// Implementation file for the extPersonType class, with its' functions
  #include &lt;iostream&gt;
  #include "ExtPerson.h"
  #include "Address.h"
  #include "Person.h"
  #include "Data.h"
  
  // sets phone to ph
  void extPersonType::setPhone(string ph)
  {
      phone = ph;
  }
  
  
  // sets ident to i
  void extPersonType::setIdentity(string i)   
  {
      ident = i;
  }
  
  
  // Prints first name, last name, street, city, state, zipcode, month,
  // day, year, phone, and identity       
  void extPersonType::print()
  {
      cout &lt;&lt; "The person's info is listed below:" &lt;&lt; endl;
      cout &lt;&lt; "First name: " &lt;&lt; firstname &lt;&lt; endl;
      cout &lt;&lt; "Last name: " &lt;&lt; lastname &lt;&lt; endl;
      cout &lt;&lt; "Street: " &lt;&lt; street &lt;&lt; endl;
      cout &lt;&lt; "City: " &lt;&lt; city &lt;&lt; endl;
      cout &lt;&lt; "State: " &lt;&lt; state &lt;&lt; endl;
      cout &lt;&lt; "Zipcode: " &lt;&lt; zipcode &lt;&lt; endl;
      cout &lt;&lt; "Date: " &lt;&lt; month &lt;&lt; " " &lt;&lt; day &lt;&lt; ", " &lt;&lt; year &lt;&lt; endl;
      cout &lt;&lt; "Phone number: " &lt;&lt; phone &lt;&lt; endl;
      cout &lt;&lt; "Person type: " &lt;&lt; ident &lt;&lt; endl;
  }
  </code></pre>
  
  <p>Here is my Person.h file:</p>
  
  <pre><code>// Header file for personType class, with its' prototypes and variables
  #ifndef PERSON_H
  #define PERSON_H
  #include &lt;string&gt;
  using namespace std;
  
  class personType
  {
      protected:
          string firstname;
          string lastname;
      public:
          // personType constructor
          personType(string fn, string ln);
  
          // copy constructor
          personType(const personType &amp;obj)
          {
              firstname = obj.firstname;
              lastname = obj.lastname;
          }
  
          // setFirstName prototype
          void setFirstName(string fn);
  
          // setLastName prototype
          void setLastName(string ln);
  
          // getFirstName function prototype
          string getFirstName()
          {
              return firstname;
          }
  
          // getLastname function prototype
          string getLastName()
          {
              return lastname;
          }
  
          // print prototype
          void print();
  };
  
  #endif
  </code></pre>
  
  <p>Here is my Person.cpp file:</p>
  
  <pre><code>// Implementation file for personType class, with its' function definitions
  #include &lt;iostream&gt;
  #include "Person.h"
  
  // personType constructor
  personType::personType(string fn, string ln)
  {
      firstname = fn;
      lastname = ln;
  }
  
  // sets firstname to fn 
  void personType::setFirstName(string fn)
  {
      firstname = fn;
  }
  
  // sets lastname to ln  
  void personType::setLastName(string ln)
  {
      lastname = ln;
  }
  
  // prints the first and last name       
  void personType::print()
  {
      cout &lt;&lt; "First name: " &lt;&lt; firstname &lt;&lt; endl;
      cout &lt;&lt; "Last name: " &lt;&lt; lastname &lt;&lt; endl;
  }
  </code></pre>
  
  <p>Here is my Data.h:</p>
  
  <pre><code>// Header file for dataType class, with its' prototypes and variables
  #ifndef DATA_H
  #define DATA_H
  #include &lt;string&gt;
  using namespace std;
  
  class dataType
  {
      protected:
          int day;
          string month;
          int year;
      public:
          // dataType constructor
          dataType(int d, string m, int y);
  
          // copy constructor
          dataType(const dataType &amp;obj)
          {
              day = obj.day;
              month = obj.month;
              year = obj.year;
          }
  
          // setDay prototype
          void setDay(int d);
  
          // setMonth prototype
          void setMonth(string m);
  
          // setYear prototype
          void setYear(int y);
  
          // getMonth function prototype
          string getMonth()
          {
              return month;
          }
  
          // getDay function prototype
          int getDay()
          {
              return day;
          }
  
          // getYear function prototype
          int getYear()
          {
              return year;
          }
  
          // print prototype
          void print();
  };
  
  #endif
  </code></pre>
  
  <p>Here is my Data.cpp file:</p>
  
  <pre><code>// Implementation file for dataType class, with its' function definitons
  #include &lt;iostream&gt;
  #include "Data.h"
  
  // dataType constructor
  dataType::dataType(int d, string m, int y)
  {
      day = d;
      month = m;
      year = y;
  }
  
  // sets day to d
  void dataType::setDay(int d)
  {
      day = d;
  }
  
  // sets month to m  
  void dataType::setMonth(string m)
  {
      month = m;
  }
  
  // sets year to y   
  void dataType::setYear(int y)
  {
      year = y;
  }
  
  // prints the date  
  void dataType::print()
  {
      cout &lt;&lt; "Date: " &lt;&lt; month &lt;&lt; " " &lt;&lt; day &lt;&lt; ", " &lt;&lt; year &lt;&lt; endl;
  }
  </code></pre>
  
  <p>Here is my Address.h file:</p>
  
  <pre><code>    // Header file for addressType class, with its' prototypes and variables
      #ifndef ADDRESS_H
      #define ADDRESS_H
      #include &lt;string&gt;
      using namespace std;
  
      class addressType
      {
          protected:
              string street;
              string city;
              string state;
              string zipcode;
          public:
              // addressType constructor
              addressType(string s, string c, string st, string z);
  
              // copy constructor
              addressType(const addressType &amp;obj)
              {
                  street = obj.street;
                  city = obj.city;
                  state = obj.state;
                  zipcode = obj.zipcode;
              }
  
              // setStreet function prototype
              void setStreet(string s);
  
              // setCity function prototype
              void setCity(string c);
  
              // setState function prototype
              void setState(string st);
  
              // setZipcode function prototype
              void setZipcode(string z);
  
              // getStreet function prototype
              string getStreet()
              {
                  return street;
              }
  
              // getCity function prototype
              string getCity()
              {
                  return city;
              }
  
              // getState function prototype
              string getState()
              {
                  return state;
              }
  
              // getZipcode function prototype
              string getZipcode()
              {
                  return zipcode;
              }
  
              // print function prototype
              void print();
      };
  
      #endif
  
  Here is my Address.cpp file:
  
  // Implementation file for addressType class, with its function definitions
  #include &lt;iostream&gt;
  #include "Address.h"
  
  // addressType constructor
  addressType::addressType(string s, string c, string st, string z)
  {
      street = s;
      city = c;
      state = st;
      zipcode = z;
  }
  
  // sets street variable to s    
  void addressType::setStreet(string s)
  {
      street = s;
  }
  
  // sets city to c   
  void addressType::setCity(string c)
  {
      city = c;
  }
  
  // sets state to st 
  void addressType::setState(string st)
  {
      state = st;
  }
  
  // sets zipcode to z    
  void addressType::setZipcode(string z)
  {
      zipcode = z;
  }
  
  // prints street, city, state, and zipcode      
  void addressType::print()
  {
      cout &lt;&lt; "Street: " &lt;&lt; street &lt;&lt; endl;
      cout &lt;&lt; "City: " &lt;&lt; city &lt;&lt; endl;
      cout &lt;&lt; "State: " &lt;&lt; state &lt;&lt; endl;
      cout &lt;&lt; "Zipcode: " &lt;&lt; zipcode &lt;&lt; endl;
  }
  </code></pre>
  
  <p>Any ideas on how I'm getting this error? Thanks in advance.</p>