For faster navigation, this Iframe is preloading the Wikiwand page for C23 (C语言标准).

C23 (C语言标准)

此条目可参照英语维基百科相应条目来扩充。 (2024年4月1日)若您熟悉来源语言和主题,请协助参考外语维基百科扩充条目。请勿直接提交机械翻译,也不要翻译不可靠、低品质内容。依版权协议,译文需在编辑摘要注明来源,或于讨论页顶部标记((Translated page))标签。

C23 是 ISO/IEC 9899:2024 的非正式名称, 同时也是 C语言C18 标准(ISO/IEC 9899:2018)[1]后的又一次更新。 这项项目在2016年时被非正式的称为 C2x [2],并预计在2024年发布。 最新公开的 C23 草案在2023年4月1日发布。 第一次C2X草案的 WG14 会议是在 2019年10月举行 [3], 由于新冠疫情, 这些会议在2020年一度改为在线远程的形式。 这些会议在2024年仍在持续著。

特色

[编辑]

到草案阶段, C23 有以下特色[4]

新的语言特色

[编辑]
  • 加入特性,以双重方括号 [[ ]] 表示,用以标记一些资讯供编译器识别

新的形别与关键字

[编辑]
  • 空指针:加入 nullptr_t 类型以代表空指针,并加入 nullptr 常量
  • 整数:加入 _BitInt(N) unsigned _BitInt(N) 以支持64位以上的大整数
  • 10进位小数:加入 _Decimal32, _Decimal64,_Decimal128 关键字,用来表示10进位小数
  • 加入 char8_t 表示 UTF8 类型字符串
  • 将一些 C11 存在的关键字改为小写并去掉前置下划线,如 _Bool 改为 bool,以前的写法主要是为了避免与旧的代码发生冲突。
  • 加入 truefalse 关键字

新的宏

[编辑]
  • 加入 #elifdef#elifndef 两个新宏,这两个其实和过去的 #elif defined 以及 #elif !defined 等价

新的函示库

[编辑]

编译器支持

[编辑]

引用

[编辑]
  1. ^ 14:00-17:00. ISO/IEC 9899:2018. ISO. [2024-03-30]. (原始内容存档于2018-08-10) (英语). 
  2. ^ WG 14 N 2086 -- C2x Charter. www.open-std.org. [2024-03-30]. (原始内容存档于2022-12-22). 
  3. ^ N 2437: Agenda for October, 2019. www.open-std.org. [2024-03-30]. (原始内容存档于2021-03-05). 
  4. ^ 14:00-17:00. ISO/IEC DIS 9899. ISO. [2024-03-30]. (原始内容存档于2024-05-06) (英语). 
{{bottomLinkPreText}} {{bottomLinkText}}
C23 (C语言标准)
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?