Hi everyone, nice to meet you~ I will be very grateful if you help me.
these are my following code in my class with the name of song. No syntax error, but when i run it, it will skip the name part and straight to the genre part.
May I know where did i type wrong? @@
class song
{
int index=001;
string song_name;
string song_genre;
string song_singer;
public:
void add_song()
{
cout << "Adding new song mode"<<endl;
cout << "Current song index="<< index<<endl;
cout << "Please enter song name:";
getline(cin,song_name);
cout << "Please enter the song genre:";
getline(cin,song_genre);
cout << "Please enter the song's singer:";
getline(cin,song_singer);
index++;
}
};