I have this class and have, among other things, a client print function. I have an assignment to make a client print function, however we weren't really told how to use ostream in a class, and what I'm doing doesn't seem to be right. This wasn't covered in our textbook.
Anyway, this is what I have for the function.
Basically, it just traverses a sorted linked-list and prints all the data. But I get this error:Code:template <class ItemType> void SortedType<ItemType>::PrintList(ostream& dataFile) { Nodetype* location = listData; if(location = NULL) return; do { dataFile<<location->data<<endl; location = location->next; } while(location->next != NULL) }
"error C2061: syntax error : identifier 'ostream'"
I included iostream, but it doesn't seem to do anything. Where am I going wrong? Thanks,
-Tristan