The requirement is to create an stream, pass it to second function for modification, (it has to be passed in this way since the output need to access private data members of a separate class). and then output the modified stream. It compiles as is but returns only the address of MyStream, I need it to return the stream.
/* Prints the details of the media collection. */
void MediaCollection::PrintMediaDetails() const{
ostream MyStream(NULL);
for(int i = 0; i < CurrentMCSize; i++){
TheCollection[i]->PrintMedia(MyStream);
cout << i + 1 <<" : "<<&MyStream;
}
}
/*Takes Stream and and returns data members*/
void Media::PrintMedia(ostream & Out) const{
Out<<Title<<" "<<Artist<<" "<<&RunningTime<<endl;
}