This prototype does not match the definition. How do i fix it? I threw a const on b.c. I thought that might do it. But not go
I know it needs the template designator in the definition even though it does not use the template…because this was a previous error.
// Prototype
template <class T> class dynamic_array
{
public:
void print_operator(ostream)const;
};
// Definition
template <class T> void dynamic_array<T>::print_operator(ostream &os=cout)const
{
for (int i = 0; i < size; i++) os << array[i] << endl;
}
1 Answer