vendredi 8 février 2019

getch() alternate OR to return control back to code

I have following code, but it is not breaking while loop even if done is TRUE. It keeps waiting for _getch().

   while (done || ((c = _getch()) != EOF))
   {
       cout << "Operation aborted" << endl;
       break;
   }
   cout << "Operation finished" << endl;

How to break if done is true

Aucun commentaire:

Enregistrer un commentaire