"delimit' in string class.

I leant there's a new feature string class has, which is the delimit. So I had a try, which occur some weird little problem with it.

1
2
3
4
string l;
getline(cin, l, ':');
cout << l;
cin.get();


the result of the preceding code is being shut down of the console window right away.

I tried while(cin.get()!='\n'); then, but it doesn't stop looping.

I am a bit curious about how the "delimit" feature work? though seem we seldom use it practically.
I finally find the answer. It's because of the characters behind the delimiter ':'.
Topic archived. No new replies allowed.