I need to input a line of characters, discard invalid characters, but keep the valid ones. Getline and get aren't working. It prints my cout "invalid" statements before user can input. I'm trying to input character array now. How to break out of loop once user has hit "return"?
while(cin)
{
cin>>chararray[length];
length++;
}