开发者

integer, printf: is there a way to write an integer as a wide char to console without locale.h?

开发者 https://www.devze.com 2023-03-07 15:32 出处:网络
suppose 开发者_开发问答I have a Unicode codepoint c (a uint32). Is there a way to print this integer to console (as a wide character) without using locale.h or wchar.h? Thanks.You can try to use

suppose 开发者_开发问答I have a Unicode codepoint c (a uint32). Is there a way to print this integer to console (as a wide character) without using locale.h or wchar.h? Thanks.


You can try to use

printf("%lc", c);

though you really need to make sure that c is a wint_t (which requires wchar.h) rather than a uint32_t, even though the two are most likely the same type...


http://www.cplusplus.com/reference/clibrary/cstdio/printf/

printf("%u", c);
0

精彩评论

暂无评论...
验证码 换一张
取 消