consider this code snippet in c++ -
string str;
cin>>str;
If I simply press enter at this stage, the pointer moves to next line but keep waiting for the input even if I intentionally want to input an empty string.
My objective is to read a word. And If I press enter, it should be taken as a empty string.