本文介绍了wchar_t 未签名或已签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在这个链接 unsigned wchar_t
被 typedef
编为 WCHAR
.但是我在我的 SDK winnt.h
或 mingw winnt.h
中找不到这种 typedef.
In this link unsigned wchar_t
is typedef
ed as WCHAR
. But I cant find this kind of typedef in my SDK winnt.h
or mingw winnt.h
.
wchar_t
是有符号的还是无符号的?
wchar_t
is signed or unsigned?
我在 C 语言中使用 WINAPI.
I am using WINAPIs in C language.
推荐答案
wchar_t
的符号性未指定.标准只说(3.9.1/5):
The signedness of wchar_t
is unspecified. The standard only says (3.9.1/5):
类型 wchar_t
应与其他整数类型之一具有相同的大小、签名和对齐要求 (3.11),称为其底层类型.
(相比之下,类型 char16_t
和 char32_t
是明确无符号的.)
(By contrast, the types char16_t
and char32_t
are expressly unsigned.)
这篇关于wchar_t 未签名或已签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!