C: Vérifier si un caractère peut être utilisé en hexadécimal avec ‘isxdigit(char c)’

Author:


Download

  #include 
  #include 

  int main(void)
  {

	/*
     int isxdigit(char ch): Retourne une valeur supérieur à zéro
	 si le caractère est hexadécimal

     */
    char ch;
    puts("Tapez Q pour quitter");
    for(;;) {
      ch = getchar();
      if(ch == 'q'){
          break;
      }
      if(isxdigit(ch))
	  {
          printf("%c est hexadécimaln", ch);
      }
    }

    return 0;
  }

Leave a Reply

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