read pair of characters separated by \t c++
- by Kiran
Friends,
I want to read a pair of characters separated by \t. I want to continue reading the input until user enters z for any of the characters.
Here are the options I thought:
while (cinch1ch2)
{
// process ch1 & ch2
}
std::string str;
while (getline(cin, str) ){
//split string
}
Also, I want to validate the input to make sure that it is correct. Please suggest the best way. If this is a duplicate, please point me to the right one.
Thanks.