Hilfee!! std::list und access-violation :(
-
Hi!
Ich hab mir ein kleines prog geschrieben, mit ner std::list, aber beim ausgeben bekomm ich ne access-vio
hier mal der code////////////////////////////////////////////////////////////////////////////////////////////////// // Name: PrintAlbumListToScreen() // Desc: Prints the list to screen. ////////////////////////////////////////////////////////////////////////////////////////////////// void PrintAlbumListToScreen(std::list<LPMIAlbum> pList, bool bWithTracks) { std::list<LPMIAlbum>::iterator pIt = pList.begin(); std::list<LPMITrack>::iterator pTIt = (*pIt)->pTracks.begin(); int i = 0, j = 0; cout << "# Title Artist ReleaseDate Lable TrackCount" << endl; cout << "-------------------------------------------------" << endl; while(*pIt) { cout << i << " "; cout << (*pIt)->strTitle << " "; //HIER KOMMT DIE ACCESS-VIOLATION!! cout << (*pIt)->strArtist << " "; cout << (*pIt)->strReleaseDate << " "; cout << (*pIt)->strLable << " "; cout << (*pIt)->iTrackCount << endl; while(*pTIt) { cout << " "; cout << j << " "; cout << (*pTIt)->strTitle << " "; cout << (*pTIt)->strArtist << " "; cout << (*pTIt)->strReleaseDate << endl; j++; ++(*pTIt); } i++; ++(*pIt); } cout << endl; } //////////////////////////////////////////////////////////////////////////////////////////////////
also es müsste was in der ll drin stehen, da ich sie vorher mit daten gefüttert habe !
greets,
cNcp.s: LPMIxx -> *MIxx, oder sollte ich lieber normale elemente(also keine pointer) in der list verwenden?
p.p.s: seit wann haben structs destructoren?!
-
versuchs mal mit pIt != pList.end() und beim anderen auch entsprechend...
Devil
-
Habs hinbekommen, hab statt pointern normale elemente genommen, jetzt funtzt alles!