wchar_t 未签名或已签名 [英] wchar_t is unsigned or signed

查看:35
本文介绍了wchar_t 未签名或已签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这个链接 unsigned wchar_ttypedef 编为 WCHAR.但是我在我的 SDK winnt.h 或 mingw winnt.h 中找不到这种 typedef.

In this link unsigned wchar_t is typedefed 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),称为其底层类型.

Type wchar_t shall have the same size, signedness, and alignment requirements (3.11) as one of the other integral types, called its underlying type.

(相比之下,类型 char16_tchar32_t 是明确无符号的.)

(By contrast, the types char16_t and char32_t are expressly unsigned.)

这篇关于wchar_t 未签名或已签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆