IHYPRESS PROGRAMMING
Tutorials and C programs with code and output for beginners
c programming
HOME | ASP | C | CSS | GNUPLOT | HTML | JAVASCRIPT | PERL | PHP | PYTHON | RUBY | SVG
CData Types & Operators : Printing Unicode Characters
<02.12>
// Printing Unicode characters in C // Unicode table: https://ihypress.net/programming/unicode #include <stdio.h> #include <wchar.h> #include <locale.h> int main (void) { // declaring and printing a variable named star of type wchar_t (wide unicode) wchar_t star = 0x2605; // declaring a string of Unicode characters wchar_t unistring[] = {0x2601,0x222d,0x2600, '\0'}; // set location to get the Unicode characters displayed correctly setlocale(LC_CTYPE, ""); // printing a Unicode character using wprintf with a %lc placeholder wprintf(L"%lc\n", star); // printing a string of Unicode characters using wprintf with a %ls placeholder wprintf(L"%ls\n", unistring); return (0); }
Hergestellt in Deutschland / Made in Germany
★ ☁∭☀
COPYRIGHT © 2015-2024 IHY PRESS Frankfurt am Main 60329 Deutschland