C/C++: Exemple d’une boucle infinie ou illimitée

Author:


Download


#include 
#include 
void main()
{

  int total=0;
   printf("Pour arrêter la boucle, appuyez"
	   "sur n'importe quelle touche");
   /* Boucle infinie */
   for( ;; ) {
     total += 1;
     printf("%dn",total);

     if(kbhit())  // vérifier si un touche à été appuyée
       break;
   }

}

Leave a Reply

Your email address will not be published. Required fields are marked *