Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C++ (http://www.go4expert.com/forums/cpp/)
-   -   String Problem (http://www.go4expert.com/forums/string-problem-t16467/)

Carlos 7Mar2009 03:59

String Problem
 
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

xpi0t0s 7Mar2009 05:37

Re: String Problem
 
http://www.cplusplus.com/doc/tutorial/basic_io.html

shabbir 7Mar2009 08:51

Re: String Problem
 
use cin.getline();


All times are GMT +5.5. The time now is 21:02.