I got a code which seems redundant to me:
char c;
cin>>c;
if(cin&&c=='n')
//do something
I don't understand the value of introducing cin in if, Isn't it always going to have TRUE value as I've never encountered any case (in my limited experience) where this istream object is not constructed.
Similarly I've seen this as well:
if(cin)
Please correct me where am I going wrong. Now folks don't post the error-in-stream part as that I already know, the major part is when does a stream fails apart from failure of ios_base::Init