Can somebody please explain me what's wrong with this code???
getline() here supposed to read a whole line at a time.... right...???
but doesn't do anything... s1 doesn't have any value when you feed it a whole line...
s reads a word terminated by '\0'... that's fine but s1 doesn't ...
using namespace std;
cout << "Enter a word:" << endl;
string s, s1;
cin >> s;
cout << "You Entered " << s << '\n';
cout << "Enter a sentence: \n";
cout << "You Entered " << s1 << '\n';
I'm using Visual Studio 6.