int i = 97; printf("%c %i\n", i, i); // Affichera "a 97" char c = 'a'; printf("%c %i\n", c, c); // Affichera "a 97" if ('a' == 97) { // Est vrai. }
je récupère ensuite le code ASCII de chacun des caractères de cette chaine.
// Recherche valeur de É avec l'API CharToOem char src[] = "É"; char dst[2]; CharToOemA(src, dst); printf("d=%d \t c=%c \t s=%s \r\n", dst[0], dst[0], dst); //trouve -112 // Du coup... char ch = (char)-112; // <------------------- ICI printf("c=%c\r\n", ch); // -112 ok, affiche bien É