print array member function
I am trying to write a simple function that will print my array of clocks. I have a function called display_time() for the clocks:
Code:
void clock::display_time()
{
cout << "Current time is: " << _hours << ":" << setfill ('0') << setw(2) << _mins << " ";
if (_morn)
cout << "AM" << endl;
else
cout << "PM" << endl;
}
And my print function is:
Code:
void clock::print_clocks(clock& array)
{
for (int i = 0; i < array._used; i ++)
{
cout << array[i].display_time() << endl;
}
}
The error I'm getting at compile is:
"no match for clock&[int&]" at the "cout << array[i].... line."
What does this mean?
Brian