When i put comments in 24th line, in declaration of class Array, everything works. friend ostream & operator<< <>(ostream &, const Array<T> &);
But I still have ostream operator << used little before main() function.
Both the template class and the template function need to be declared before they are defined.
Of course, if you don't need the friend declaration on line 24 (you said it works without it), then get rid of it. It only needs to be a friend if it needs access to the class' private members.
Yes, It also worked when I deleted 24th line so then ostream function was part of class Array and not friend function, right?
Thank you for quick reply. It works now with the tips you gave me. This is just example from the book I am reading currently so that's why it has to be friend func.