Line 63: Song** song_array = new Song*[strlen(title->text)]; // I don't think you want strlen()?
-> Song** song_array = new Song*[cd->num_tracks];
Line 65: An array starts with 0 -> for(int i = 0; i < num_tracks; i++)
Oh and, why do you impersonate std::string (= reinvent the wheel)?
I'm pretty sure you have a massive memory leak problem (and perhaps other problems like pointer copy)
The String file is what my professor gave us, we had to write one ourselves but he gave us one that he did and we are supposed to use it for this assignment.
Im thinking the fact that I have yet another for loop in addSong you be messing it up seeing how im only taking in one song at a time. Ive tried to fox it but it doesnt like that im trying to convert Song* to Song**
any ideas on how to fix that?
Thanks for your help ive made some changes and i know my code is a big mess right now
1 2 3 4 5 6 7 8 9 10
Song** song_array = new Song*[cd->num_tracks];
int num_tracks = cd->num_tracks;
Song* song = createSong(title, length);
song_array = song;
/*for(int i = 0; i <= num_tracks; i++)
{
Song* song = createSong(title, length);
song_array[i] = song;
}*/
cd->song_array = song_array;