Can someone please help me find what's wrong with this code. I know it's not a syntax error because the program runs, but it comes up with an error as soon as i've eneterd the fifth song.Code:#include <iostream> #include <string> using namespace std; int main() { string songs[4]; int song2; string song; int index; for (index = 0; index < 5; index ++) { cout << "please enter the name of song number " << index + 1; cin >> song; songs[index] = song; } cout << "Please enter the number of the song that you want"; cin >> song2; cout << endl << "you have chosen " << songs[0]; }
It says "Debug assertaion failed!"
Anyone else had this problem? Please help.
Thanks.



LinkBack URL
About LinkBacks


