This question has already been answered:
Know, tell me what the error is. Such a task is set, it is necessary to implement the interface of the home audio collection, created it so
struct Songs { char name_autor[50]; char name_song[50]; double time; }; class Audio_Collection { public: Songs audio[N]; void set_audio(); void print_audio(); void sort_name_autor(); void sort_name_song(); void sort_time(); }; Here is the implementation of f-ii data entry,
void Audio_Collection::set_audio() { for (int i = 0; i < N; i++) { cout << "Введите имя автора(группы): "; cin.getline(audio[i].name_autor, 50); cout << "Введите название песни: "; cin.getline(audio[i].name_song, 50); cout << "Введите продолжительность трека: "; cin >> audio[i].time; } } And here's the catch, when entering data, this error occurs 
When you enter the second subsequent values, the string is not executed.
cin.getline(audio[i].name_autor, 50); How to fix it?