J
John J
I have written the following overload of operator << as a display function.
In the code I unsuccessfully try and call a function within another class(<<
"Race : " << r->Show () << endl). The Show function is in a class called
Race which is also included below. I'd greatly appreciate some guidance on
what I'm doing wrong.
Thanks for any help
ostream& operator<< (ostream& out, const Entry& e)
{
Race* r;
out << "Yacht : " << *(e.what) << endl
<< "Race : " << r->Show () << endl
<< "Finish Place : " << e.place << endl
<< "Finish Time : " << e.time << endl << endl;
return out;
}
//Show () function within a Race class
void Race::Show (ostream& out) const
{
out << "Race Number : " << number << endl
<< "Race Date : " << date << endl << endl;
}
In the code I unsuccessfully try and call a function within another class(<<
"Race : " << r->Show () << endl). The Show function is in a class called
Race which is also included below. I'd greatly appreciate some guidance on
what I'm doing wrong.
Thanks for any help
ostream& operator<< (ostream& out, const Entry& e)
{
Race* r;
out << "Yacht : " << *(e.what) << endl
<< "Race : " << r->Show () << endl
<< "Finish Place : " << e.place << endl
<< "Finish Time : " << e.time << endl << endl;
return out;
}
//Show () function within a Race class
void Race::Show (ostream& out) const
{
out << "Race Number : " << number << endl
<< "Race Date : " << date << endl << endl;
}