String Problem

Carlos's Avatar, Join Date: Dec 2008
Contributor
Hello! everyone , Can anyone tell me how take input of string, so that data after the space don't lose.

whenever i input a string it take the first word and neglect the whole sentence.

string str1;
cin>>str1;
cout <<str1;

Thanx
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
use cin.getline();