My head is literally about to explode with this...
I'm trying to write a CD Collection program and I have an array where you enter an album title, artist name, and year released. My problem is, the information will not save into its array and the counter will not increase. Here is what I mean...
struct CompactDisc
{
string title;
string artist;
string year;
};
int add(CompactDisc CDs[], int& count)
{
cout << "Enter the album title: "<< endl;
getline(cin,CDs[count].title);
cout << "Enter the artist: "<< endl;
getline(cin,CDs[count].artist);
cout << "Enter the year released: "<< endl;
getline(cin,CDs[count].year);
count++;
cin.ignore(50,'\n');
cout << "Your CDs have been added to the database." << endl;
main();
return 0;
}
Hope that's enough information.
