How to declare and print wide character in C

2 Answers

0 votes
#include <stdio.h>
#include <wchar.h>
#include <locale.h>

int main(void)
{
    setlocale(LC_ALL, "en_US.utf8");
    
    wchar_t wch = L'\u05d0'; 
    
    putwchar(wch);
}




/*
run:

א

*/

 



answered Feb 11, 2023 by avibootz
0 votes
#include <stdio.h>
#include <wchar.h>
#include <locale.h>

int main(void)
{
    setlocale(LC_ALL, "en_US.utf8");
    
    wchar_t wch = L'\u05d0'; 
    
    wprintf(L"%lc", wch);
}




/*
run:

א

*/

 



answered Feb 11, 2023 by avibootz

Related questions

1 answer 150 views
1 answer 138 views
138 views asked Jul 31, 2022 by avibootz
1 answer 145 views
1 answer 117 views
117 views asked Aug 7, 2024 by avibootz
...