when I use while(cin>> ){} in my program how to end the input?
I tried Ctrl+D and also Ctrl+Z, but none of them work. outputs of both cin>>^Z and cin>>^D are true. 
How to let the program know that the file ends? How to pass NUL character such that the output of cin>> be false and while end? 
 
     
     
    