String Problem

Contributor
7Mar2009,03:59   #1
Carlos's Avatar
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
Go4Expert Founder
7Mar2009,08:51   #3
shabbir's Avatar
use cin.getline();