i've got this code:

Code:
cout <<"insert a string: ";
std::string s;
cin>>s;
when i enter a string with spaces cin only records in s til the first space.

example:

insert a string: Hello world!

only hello is stored in s.

I've heard that the getline functions solves this. I read Eckel's thinking in c++ vol 2 but i couldn't understand how to use it. Would you mind telling me?
thanls!!