1

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?

Anthon
  • 69,918
  • 32
  • 186
  • 246
Hana
  • 11
  • 2

1 Answers1

0

I tried this on linux machine and Ctrl+d works fine.If you are using Mac OS you can check this link

Community
  • 1
  • 1
Manthan Tilva
  • 3,135
  • 2
  • 17
  • 41