Have a look at the stream operator>>here and operator!here. The extraction operator returns a reference to the stream, not a boolean value. You can check the stream state through its provided interface.
I have been trying to take input until empty string is entered(simply press enter) ?
The >> operator doesn't recognize whitespace except as a delimiter on both sides. If you just press enter, it's ignored while the >> operator waits for non-whitespace. To check for a blank line you would use getline():
using namespace std;
while (getline(cin, buff) && !buff.empty())
cout << "'" << buff << "'" << endl;
But that doesn't have the same behavior as the >> operator if you want to read words instead of lines. What kind of behavior do you want for user input?
The extraction operator returns a reference to the stream, not a boolean value.
But the stream object has a conversion to boolean when in boolean context. Prior to C++11 the conversion was to void* and then to boolean from there, and in C++11 there's a direct conversion to bool.