so i declared a multiset header in my class declaration:
Code:
private:
multiset<MediaRecord>mySongs;
multiset<MediaRecord>::iterator blah;
then in my member functions I wonna do stuff like:
Code:
bool MediaPlayer::saveFile(const string& filename){
ofstream outfile(filename.c_str());
if ((outfile << "#CS201PLAYLISTFILE2#" << endl)){
for(blah = mySongs.begin(); blah != mySongs.end(); blah++){
outfile <<endl<< *blah->getTitle() << endl
<< *blah->getAuthor() << endl
<< *blah->getGenre() << endl
<< *blah->getLength() <<endl;
cout<<"\nsave successful\n";
return true;
}
return false;
}
but i'm getting errors like:
'std::iterator' : use of class template requires template argument list
error C2501: 'MediaPlayer::multiset' : missing storage-class or type specifiers
error C2143: syntax error : missing ';' before '<'
where I declared the multiset and
error C3861: 'blah': identifier not found, even with argument-dependent lookup
where I try to use the interator.
am I missing something? do i need to include a file to use the multiset template? or is this completely wrong?
sorry if this is a dumb question...