void Add(string artist[], string song[], int i, int j)
{
string line;
size_t found;
cout << "Please enter the artist and song you would like to add:" << endl;
getline(cin,line);
found = line.find(':');
artist[i] = line.substr(0,found);
song[j] = line.substr(found + 1);
Show(artist, song, i, j);
}
I want to generate a substring from the user input using the getline function, but when I run the program it just skips the user input and nothing happens. I also tried:
cin.getline(line, 256);
but received an error when i tried that. Thoughts? Ideas? Thanks in advance.