iswprint(): Vérifie si son argument est un caractère d’impression

Author:


Download


#include 
#include 

int main(void)
{
   int wc;

   for (wc=0; wc <= 128; wc++)
   {
      printf("%3d", wc);//Le code du caractère
      printf(" %5c ", wc);
	  //Cochoer les caractères d'impression
      printf("%2s", iswprint(wc)  ? "X"  : "-");

      putchar('n');
   }
   return 0;
}

 /*
  Apreçu du Résultat:
  ------------------

    0        -
  1     ?  -
  2     ?  -
  3     ?  -
  4     ?  -
  5     ?  -
  6     ?  -
  7       -
  8      -
  9               -
 10
  -
 11     ?  -
 12     ?  -
  -
 14     ?  -
 15     ¤  -
 16     ?  -
 17     ?  -
 18     ?  -
 19     ?  -
 20     ¶  -
 21     §  -
 22     ?  -
 23     ?  -
 24     ?  -
 25     ?  -
 26     ?  -
 27     ?  -
 28     ?  -
 29     ?  -
 30     ?  -
 31     ?  -
 32        X
 33     !  X
 34     "  X
 35     #  X
 36     $  X
 37     %  X
 38     &  X
 39     '  X
 40     (  X
 41     )  X
 42     *  X
 43     +  X
 44     ,  X
 45     -  X
 46     .  X
 47     /  X
 48     0  X
 49     1  X
 50     2  X
 51     3  X
 52     4  X
 53     5  X
 54     6  X
 55     7  X
 56     8  X
 57     9  X
 58     :  X
 59     ;  X
 60     <  X
 61     =  X
 62     >  X
 63     ?  X
 64     @  X
 65     A  X
 66     B  X
 67     C  X
 68     D  X
 69     E  X
 70     F  X
 71     G  X
 72     H  X
 73     I  X
 74     J  X
 75     K  X
 76     L  X
 77     M  X
 78     N  X
 79     O  X
 80     P  X
 81     Q  X
 82     R  X
 83     S  X
 84     T  X
 85     U  X
 86     V  X
 87     W  X
 88     X  X
 89     Y  X
 90     Z  X
 91     [  X
 92       X
 93     ]  X
 94     ^  X
 95     _  X
 96     `  X
 97     a  X
 98     b  X
 99     c  X
100     d  X
101     e  X
102     f  X
103     g  X
104     h  X
105     i  X
106     j  X
107     k  X
108     l  X
109     m  X
110     n  X
111     o  X
112     p  X
113     q  X
114     r  X
115     s  X
116     t  X
117     u  X
118     v  X
119     w  X
120     x  X
121     y  X
122     z  X
123     {  X
124     |  X
125     }  X
126     ~  X
127     ¦  -
128     Ç  -
*/        

Leave a Reply

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