istream.getline allows you to specify a separator to use instead of the standard '\n' :
cin.getline (char* s, streamsize n, char delim );
or a safer and easier way is to use std :: getline . With this method, you donβt have to worry about allocating a buffer large enough for your text.
string s; getline(cin, s, '\t');
EDIT:
As a side note, since it seems like you're just learning C ++, the correct way to read multiple separator lines is:
string s; while(getline(cin, s, '\t')){
source share