简体   繁体   中英

Printing out extended ascii characters from an array

So I am trying to print out an alphabet with some extended special characters but all I get is warnings and wrong letter warning: multi-character character constant [-Wmultichar]

The array

char letters[30] = {
        'a', 'b', 'c','č','ć', 'd','dž','đ', 'e', 'f', 'g', 'h',
        'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
        'r', 's','š', 't', 'u', 'v', 'w', 'z', 'ž' };

for (i = 0; i < 30; i++)
     printf("%c", letters[i]);

You aren't going to be able to print out those non-ASCII characters with printf as they are currently formatted. Those don't even appear to be extended ASCII.

To see what characters are printable simply run the code provided in this post ASCII Print Function.

To read more about this you can view this post on printing non-ascii characters: Printing Non-Ascii in c

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM