I have a "two stage" inheritance piece I'm writing. The overall class is telnumber, the worknumber is derived from telnumber, and billnumber is derived from worknumber. The problem is in in my billnumber.cpp. In the main there are two lines referring to the billnumber class with only 4 parameters, and one with 5 parameters. The one with 5 parameters compiles fine, but the two lines with 4 parameters give me the error message "No overloaded function takes 4 arguments. Below is my billnumber cpp. How do I add in a copy constructor for 4 arguments as well as 5?
#include "billnumber class.h"
billnumber::billnumber():
worknumber("","","","")
{
}
billnumber::billnumber(string i_npa, string i_nxx, string i_line, string i_name, int i_numlines):
worknumber(i_npa, i_nxx, i_line,i_name)
{
}
void billnumber::setnumlines(int& newnumlines)
{
numlines=newnumlines;
}
int billnumber::getnumlines()
{
return (numlines);
}
billnumber::~billnumber()
{
}
Here is the main:
ostream& operator << (ostream &out, telnumber &tn)
{
tn.printtostream(out);
return out;
}
int main()
{
telnumber yournumber;
telnumber paul("719","590","6768");
telnumber bob("719","590", "6729");
worknumber csstaff1 ("719","590","6732","Book Store");
worknumber csstaff2 ("212","371","6940","Borland C++ Guru");
worknumber csstaff3 ("405","612","3433","Visual C++ Expert");
billnumber csdept ("719","590","6850","Dean of CS");
billnumber library ("719","598","6708","Librarian");
billnumber reception ("719","598","0200","Receptionist",35);
cout << "Testing the overladen << operator with the virtual" << "printtostream()\n\n";
cout << "The telephone numbers are: \n" << endl;
cout << yournumber << endl;
cout << paul << endl;
cout << bob << endl;
cout << "The working telephone numbers are: \n" << endl;
cout << csstaff1 << endl;
cout << csstaff2 << endl;
cout << csstaff3 << endl;
cout << "The billing telephone numbers are: \n" << endl;
cout << csdept << endl;
cout << library << endl;
cout << reception << endl;
cout << "Here endeth the hierarchy of the telephone!" << endl;
return 0;
}