Code:
#include <string>
#include <iostream>
using namespace std ;
void main()
{
string s1;
cout << "Enter a sentence (use <space> as the delimiter):";
getline(cin,s1, ' ');
cout << "You entered: " << s1;
}
Prototype:
template<class _E, class _TYPE, class _A> inline
basic_istream<_E, _TYPE>& getline( basic_istream<_E, _TYPE>& Istream,
basic_string<_E, _TYPE, _A>& Xstring,
const _E _D=_TYPE::newline());
Bei 2 Parametern müsste ein Return als Delimiter standardmäßig verwendet werden.