How to terminate the input by entering ctrl+z.
I have a sentinel controlled loop that should break when ctrl+z is entered.
what's the conditionCode:int x=0; while( condition ) { cin >> x; do something }
How to terminate the input by entering ctrl+z.
I have a sentinel controlled loop that should break when ctrl+z is entered.
what's the conditionCode:int x=0; while( condition ) { cin >> x; do something }
while(cin)
Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling
Ok if I have a situation like this.
what could that condition be: if ( cin )?Code:for ( ;; ) { cin >> x; if ( condition ) break; cin >> y; ........ }
Thanks for help.