Hello ppl
im trying to get user input using getline. i give this statement
while (true)
{
if (!getline(cin, string, '/'))
{
cout<<"invalid input"<<endl;
continue;
}
this program keeps on getting input until i give '/' in cin.
Question:
is there anyway if i dont give '/' and give anyother input and it should give me an error that it was a valid input(should have / at end)...
currently it doest give the error and keeps on getting input even if i hit enter unless i give it '/' delimitor.Code:while (true)