|
|
cin>>separator;
this operation reads only one character from the standard input stream , if your keyed in a char and then pressed the return button to proceed to the next line the new line character is left in the stream and will be read by you getline instruction, a solution would be to clear your stream of any leftover characters using cin.ignore() function