How to use extended ASCII table characters in C?

I tried to print extended ASCII characters :

http://www.theasciicode.com.ar/

But were all these characters printed as a question mark on a white background ? .

I use the following loop to print these characters:

 for (i = 0; i <= 30; i++) printf("%c", 201); 

Question: Can I print those extended ASCII characters or not? Or maybe there is a special library for these characters?


Linux OS Ubuntu 13.04, Code :: Blocks 12.11 IDE.

+8
c character ascii extended-ascii
source share
1 answer

It is better to use unicode than extended ASCII, which is non-standard. Thread about printing Unicode characters in C: printing-utf-8-strings-with-printf-wide-vs-multibyte-string-literals

But really you need to copy the unicode paste characters.

The best way to get started:

 #include <stdio.h> int main() { printf("\u2500\u2501\n"); } 

See https://en.wikipedia.org/wiki/Box-drawing_character#Unicode for Unicode characters for this extended ASCII style.

+12
source share

All Articles