J
John J
I've written the following function in a class called "Race.cpp". My hope is
that when called it will access the getName function in a class called
"Yacht" to display the name of a yacht object(s). The function is called in
a main using "r1.display_entries ();" where r1 is race 1, where it should
display all the names of yachts that have entered race 1; however, when I
compile and run it outputs the value "1". I'd appreciate some advice on what
I'm doing wrong. The classes are correctly declared to each other as evident
by other functions. I'm guessing it's something in the syntax or the way
I've called the other function.
Thanks for any help.
void Race::display_entries (ostream& out) const
{
out << "Yacht Name : " << Yacht::getName << endl;
}
that when called it will access the getName function in a class called
"Yacht" to display the name of a yacht object(s). The function is called in
a main using "r1.display_entries ();" where r1 is race 1, where it should
display all the names of yachts that have entered race 1; however, when I
compile and run it outputs the value "1". I'd appreciate some advice on what
I'm doing wrong. The classes are correctly declared to each other as evident
by other functions. I'm guessing it's something in the syntax or the way
I've called the other function.
Thanks for any help.
void Race::display_entries (ostream& out) const
{
out << "Yacht Name : " << Yacht::getName << endl;
}