Q:

How to store a complete sentence with white spaces in a string in cpp?

I want to store "What is wrong with you?" in a string str in cpp but when I run this code it only stores "What" in ·str·.
How can I store the complete sentence in the string.
#include<iostream>
#include<string.h>
using namespace std;
int main()
{
    string str;
    cin>>str;
    cout<<str;
} 

Input:
What is wrong with you?

Output:
What

A:

was already answered. But here is the solution:
std::string str; 
std::getline( std::cin, str);

