简体   繁体   English

在哪里可以找到当前的 C 或 C++ 标准文档?

[英]Where do I find the current C or C++ standard documents?

For many questions the answer seems to be found in "the standard".对于许多问题,答案似乎可以在“标准”中找到。 However, where do we find that?然而,我们从哪里找到呢? Preferably online.最好是在线的。

Googling can sometimes feel futile, again especially for the C standards, since they are drowned in the flood of discussions on programming forums.谷歌搜索有时会感到徒劳,尤其是对于 C 标准,因为它们淹没在编程论坛上的大量讨论中。

To get this started, since these are the ones I am searching for right now, where are there good online resources for:首先,因为这些是我现在正在搜索的,所以哪里有好的在线资源:

  • C89 C89
  • C99 C99
  • C11 C11
  • C++98 C++98
  • C++03 C++03
  • C++11 C++11
  • C++14 C++14
  • C++17 C++17

PDF versions of the standard标准的 PDF 版本

As of 1st September 2014 September 2021, the best locations by price for the official C and C++ standards documents in PDF seem to be:截至 2014 年 9 月 1 日, 2021 9 月,PDF 格式的官方 C 和 C++ 标准文档的最佳价格位置似乎是:

Non-PDF electronic versions of the standard标准的非 PDF 电子版本

Print versions of the standard标准的印刷版本

Print copies of the standards are available from national standards bodies and ISO but are very expensive.标准的印刷副本可从国家标准机构和ISO 获得,但非常昂贵。

If you want a hardcopy of the C90 standard for much less money than above, you may be able to find a cheap used copy of Herb Schildt 's book The Annotated ANSI Standard at Amazon , which contains the actual text of the standard (useful) and commentary on the standard (less useful - it contains several dangerous and misleading errors).如果您想要一份 C90 标准的硬拷贝,但价格比上面少得多,您可以在亚马逊找到Herb Schildt的书The Annotated ANSI Standard的廉价二手副本,其中包含标准的实际文本(有用)和对标准的评论(不太有用 - 它包含几个危险和误导性的错误)。

The C99 and C++03 standards are available in book form from Wiley and the BSI (British Standards Institute): C99 和 C++03 标准可从 Wiley 和 BSI(英国标准协会)以书籍形式获得:

Standards committee draft versions (free)标准委员会草案版本(免费)

The working drafts for future standards are often available from the committee websites:未来标准的工作草案通常可从委员会网站获得:

If you want to get drafts from the current or earlier C/C++ standards, there are some available for free on the internet:如果您想从当前或更早的 C/C++ 标准中获取草稿,可以在 Internet 上免费获得一些草稿:

For C:对于 C:

For C++:对于 C++:

Note that these documents are not the same as the standard, though the versions just prior to the meetings that decide on a standard are usually very close to what is in the final standard.请注意,这些文件与标准不同,尽管会议之前决定标准的版本通常与最终标准中的版本非常接近。 The FCD (Final Committee Draft) versions are password protected; FCD(最终委员会草案)版本受密码保护; you need to be on the standards committee to get them.你需要加入标准委员会才能得到它们。

Even though the draft versions might be very close to the final ratified versions of the standards, some of this post's editors would strongly advise you to get a copy of the actual documents — especially if you're planning on quoting them as references.尽管草案版本可能与标准的最终批准版本非常接近,但本文的一些编辑强烈建议您获取实际文档的副本——尤其是如果您打算引用它们作为参考。 Of course, starving students should go ahead and use the drafts if strapped for cash.当然,如果手头拮据,挨饿的学生应该继续使用汇票。


It appears that, if you are willing and able to wait a few months after ratification of a standard, to search for "INCITS/ISO/IEC" instead of "ISO/IEC" when looking for a standard is the key.看来,如果您愿意并且能够在标准批准后等待几个月,那么在寻找标准时搜索“INCITS/ISO/IEC”而不是“ISO/IEC”是关键。 By doing so, one of this post's editors was able to find the C11 and C++11 standards at reasonable prices.通过这样做,本文的一位编辑能够以合理的价格找到 C11 和 C++11 标准。 For example, if you search for "INCITS/ISO/IEC 9899:2011" instead of "ISO/IEC 9899:2011" on webstore.ansi.org you will find the reasonably priced PDF version.例如,如果您在webstore.ansi.org上搜索“INCITS/ISO/IEC 9899:2011”而不是“ISO/IEC 9899:2011”,您将找到价格合理的 PDF 版本。


The site https://wg21.link/ provides short-URL links to the C++ current working draft and draft standards, and committee papers:站点https://wg21.link/提供指向 C++ 当前工作草案和标准草案以及委员会文件的短 URL 链接:


The current draft of the standard is maintained as LaTeX sources on Github .该标准的当前草案在Github上作为 LaTeX 源进行维护。 These sources can be converted to HTML using cxxdraft-htmlgen .可以使用cxxdraft-htmlgen将这些源转换为 HTML。 The following sites maintain HTML pages so generated:以下站点维护如此生成的 HTML 页面:

Tim Song also maintains generated HTML and PDF versions of the Networking TS and Ranges TS. Tim Song还维护生成的 HTML 和 PDF 版本的 Networking TS 和 Ranges TS。

POSIX extensions to the C standard C 标准的 POSIX 扩展

The POSIX standard (IEEE 1003.1) requires a compliant operating system to include a C compiler. POSIX标准 (IEEE 1003.1) 要求兼容的操作系统包含 C 编译器。 This compiler must in turn be compliant with the C standard, and must also support various extensions defined in the "System Interfaces" section of POSIX (such as the off_t data type, the <aio.h> header, the clock_gettime() function and the _POSIX_C_SOURCE macro.)该编译器又必须符合 C 标准,并且还必须支持 POSIX 的“系统接口”部分中定义的各种扩展(例如off_t数据类型、 <aio.h>标头、 clock_gettime()函数和_POSIX_C_SOURCE宏。)

So if you've tried to look up a particular function, been informed "This function is part of POSIX, not the C standard", and wondered why an operating system standard was mandating compiler features and language extensions... now you know!因此,如果您尝试查找特定函数,被告知“该函数是 POSIX 的一部分,而不是 C 标准的一部分”,并且想知道为什么操作系统标准强制要求编译器功能和语言扩展……现在您知道了!

Online versions of the standard can be found:可以找到该标准的在线版本:

Working Draft, Standard for Programming Language C++ C++程序设计语言标准工作草案

The following all draft versions of the standard :以下是标准的所有草案版本
All the following are freely downloadable以下所有内容均可免费下载
(many of these can be found at this main GitHub link ) (其中许多可以在这个主要的 GitHub 链接中找到
2021-03-17: N4885 2021-03-17: N4885
2020-12-15: N4878 2020-12-15: N4878
2020-10-18: N4868 2020-10-18: N4868
2020-04-08: N4861 2020-04-08: N4861
2020-01-14: N4849 2020-01-14: N4849
2019-11-27: N4842 2019-11-27: N4842
2019-10-08: N4835 git 2019-10-08: N4835 git
2019-08-15: N4830git 2019年8月15日: N4830混帐
2019-06-17: N4820 git 2019-06-17: N4820 git
2019-03-15: N4810 git 2019-03-15: N4810 git
2019-01-21: N4800 git 2019-01-21: N4800 git
2018-11-26: N4791 git 2018-11-26: N4791 git
2018-10-08: N4778 git 2018-10-08: N4778 git
2018-07-07: N4762 git 2018-07-07: N4762 git
2018-05-07: N4750 git 2018-05-07: N4750 git
2018-04-02: N4741 git 2018-04-02N4741 git
2018-02-12: N4727 git 2018-02-12N4727 git
2017-11-27: N4713 git 2017-11-27: N4713 git
2017-10-16: N4700 git 2017-10-16: N4700 git
2017-07-30: N4687 git 2017-07-30: N4687 git

This seems to be the new standard:这似乎是新标准:
These version requires Authentication这些版本需要身份验证
2017-03-21:N4660 is the C++17 Draft Standard 2017-03-21:N4660是 C++17 草案标准

The following all draft versions of the standard :以下是标准的所有草案版本
All the following are freely downloadable以下所有内容均可免费下载
2017-03-21: N4659 git 2017-03-21: N4659 git
2017-02-06: N4640 git 2017-02-06: N4640 git
2016-11-28: N4618git 2016-11-28: N4618git
2016-07-12: N4606git 2016-07-12: N4606git
2016-05-30: N4594git 2016-05-30: N4594git
2016-03-19: N4582git 2016-03-19: N4582git
2015-11-09: N4567git 2015-11-09: N4567git
2015-05-22: N4527git 2015-05-22: N4527git
2015-04-10: N4431git 2015-04-10: N4431git
2014-11-19: N4296git 2014-11-19: N4296git

This seems to be the old C++14 standard :这似乎是旧的 C++14 标准
These version requires Authentication这些版本需要身份验证
2014-10-07:N4140git Essentially C++14 with minor errors and typos corrected 2014-10-07:N4140git本质上是 C++14,修正了小错误和拼写错误
2014-09-02:N4141 git Standard C++14 2014-09-02:N4141 git标准 C++14
2014-03-02:N3937 2014-03-02:N3937
2014-03-02:N3936 git 2014-03-02:N3936 git

The following all draft versions of the standard :以下是标准的所有草案版本
All the following are freely downloadable以下所有内容均可免费下载
2013-10-13: N3797git 2013-10-13: N3797git
2013-05-16: N3691 2013-05-16: N3691
2013-05-15: N3690 2013-05-15: N3690
2012-11-02: N3485 2012-11-02: N3485
2012-02-28: N3376 2012-02-28: N3376
2012-01-16: N3337 git Essentially C++11 with minor errors and typos corrected 2012-01-16: N3337 git本质上是 C++11,修正了一些小错误和拼写错误

This seems to be the old C++11 standard :这似乎是旧的 C++11 标准
This version requires Authentication此版本需要身份验证
2011-04-05:N3291 C++11 (Or Very Close) 2011-04-05:N3291 C++11(或非常接近)

The following all draft versions of the standard :以下是标准的所有草案版本
All the following are freely downloadable以下所有内容均可免费下载
2011-02-28: N3242 (differences from N3291 very minor) 2011-02-28: N3242 (与N3291 的差异很小)
2010-11-27: N3225 2010-11-27: N3225
2010-08-21: N3126 2010-08-21: N3126
2010-03-29: N3090 2010-03-29: N3090
2010-02-16: N3035 2010-02-16: N3035
2009-11-09: N3000 2009-11-09: N3000
2009-09-25: N2960 2009-09-25: N2960
2009-06-22: N2914 2009-06-22: N2914
2009-03-23: N2857 2009-03-23: N2857
2008-10-04: N2798 2008-10-04: N2798
2008-08-25: N2723 2008-08-25: N2723
2008-06-27: N2691 2008-06-27: N2691
2008-05-19: N2606 2008-05-19: N2606
2008-03-17: N2588 2008-03-17: N2588
2008-02-04: N2521 2008-02-04: N2521
2007-10-22: N2461 2007-10-22: N2461
2007-08-06: N2369 2007-08-06: N2369
2007-06-25: N2315 2007-06-25: N2315
2007-05-07: N2284 2007-05-07: N2284
2006-11-03: N2134 2006-11-03: N2134
2006-04-21: N2009 2006-04-21: N2009
2005-10-19: N1905 2005-10-19: N1905
2005-04-27: N1804 2005-04-27: N1804

This seems to be the old C++03 standard:这似乎是旧的 C++03 标准:
All the below versions require Authentication以下所有版本都需要身份验证
2004-11-05:N1733 2004-11-05:N1733
2004-07-16:N1655 Unofficial 2004-07-16:N1655非官方
2004-02-07:N1577 C++03 (Or Very Close) 2004-02-07:N1577 C++03(或非常接近)
2001-09-13: N1316 Draft Expanded Technical Corrigendum 2001-09-13: N1316扩展技术勘误草案
1997-00-00: N1117 Draft Expanded Technical Corrigendum 1997-00-00:N1117 扩展技术勘误草案

The following all draft versions of the standard :以下是标准的所有草案版本
All the following are freely downloadable以下所有内容均可免费下载
1996-00-00: N0836 Draft Expanded Technical Corrigendum 1996-00-00: N0836扩展技术勘误草案
1995-00-00: N0785 Working Paper for Draft Proposed International Standard for Information Systems - Programming Language C++ 1995-00-00:N0785 信息系统国际标准草案的工作文件 - 编程语言 C++

Other Interesting Papers:其他有趣的论文:

2021 / 2020 / 2019 / 2018 / 2017 / 2016 / 2015 / 2014 / 2013 / 2012 / 2011 2021 / 2020 / 2019 / 2018 / 2017 / 2016 / 2015 / 2014 / 2013 / 2012 / 2011

C99 is available online . C99可在线获得 Quoted from www.open-std.org :引自www.open-std.org

The lastest publically available version of the standard is the combined C99 + TC1 + TC2 + TC3, WG14 N1256 , dated 2007-09-07.该标准的最新公开版本是组合 C99 + TC1 + TC2 + TC3, WG14 N1256 ,日期为 2007-09-07。 This is a WG14 working paper, but it reflects the consolidated standard at the time of issue.这是 WG14 工作文件,但它反映了发布时的合并标准。

Draft Links:草稿链接:

C++11 (+editorial fixes): N3337 HTML , PDF C++11(+编辑修复):N3337 HTMLPDF

C++14 (+editorial fixes): N4140 HTML , PDF C++14(+编辑修复):N4140 HTMLPDF

C11 N1570 ( text ) C11 N1570文字

C99 N1256 C99 N1256

Drafts of the Standard are circulated for comment prior to ratification and publication.在批准和出版之前,标准的草案将被分发以征求意见。

Note that a working draft is not the standard currently in force, and it is not exactly the published standard 请注意,工作草案不是当前生效的标准,也不完全是已发布的标准

您可能会发现 C++0x 的国际标准草案很有用。

ISO standards cost money, from a moderate amount (for a PDF version), to a bit more (for a book version). ISO 标准需要花钱,从中等(对于 PDF 版本)到更多(对于书籍版本)。

While they aren't finalised however, they can usually be found online, as drafts.然而,虽然它们还没有最终确定,但它们通常可以在网上找到,作为草稿。 Most of the times the final version doesn't differ significantly from the last draft, so while not perfect, they'll suit just fine.大多数情况下,最终版本与上一稿没有太大区别,因此虽然不完美,但它们很适合。

The C99 and C++03 standards are available in book form from Wiley: C99 和 C++03 标准可从 Wiley 以书籍形式获得:

Plus, as already mentioned, the working draft for future standards is often available from the committee websites:另外,正如已经提到的,未来标准的工作草案通常可以从委员会网站上获得:

The C-201x draft is available as N1336 , and the C++0x draft as N3225 . C- 201x草案可用作N1336 ,C++0x 草案可用作N3225

The text of a draft of the ANSI C standard (aka C.89) is available online. ANSI C 标准(又名 C.89)草案的文本可在线获取。 This was standardized by the ANSI committee prior to acceptance by the ISO C Standard (C.90), so the numbering of the sections differ (ANSI sections 2 through 4 correspond roughly to ISO sections 5 through 7), although the content is (supposed to be) largely identical.在 ISO C 标准 (C.90) 接受之前,这是由 ANSI 委员会标准化的,因此各部分的编号不同(ANSI 部分 2 到 4 大致对应于 ISO 部分 5 到 7),尽管内容是(假设是)在很大程度上相同。

The ISO C and C++ standards are bloody expensive. ISO C 和 C++ 标准非常昂贵。 On the other hand, the INCITS republishes them for a lot less.另一方面,INCITS 重新发布它们的价格要低得多。 http://www.techstreet.com/ seems to have the PDF for $30 (search for INCITS/ISO/IEC 14882:2003). http://www.techstreet.com/似乎有 30 美元的 PDF(搜索 INCITS/ISO/IEC 14882:2003)。

Hardcopy versions are available, too.也有硬拷贝版本。 Look for the British Standards Institute versions, published by Wiley.查找由 Wiley 出版的英国标准协会版本。

The actual standards documents may not be the most useful.实际的标准文件可能不是最有用的。 Most compilers do not fully implement the standards and may sometimes actually conflict.大多数编译器并没有完全实现标准,有时可能会发生实际冲突。 So the compiler documentation that you would already have will be more useful.因此,您已经拥有的编译器文档将更有用。 Additionally, the documentation will contain platform-specific remarks and notes on any caveats.此外,该文档将包含特定于平台的备注和有关任何警告的注释。

Although not an actual standard, there is an amendment to ISO C (C89/90) called C94/95, or Normative Addendum 1. It was integrated into C99, although some compilers such as Clang allow you to specifiy -std=c94 on the command line.虽然不是一个实际的标准,有一个修正案称为C94 ISO C(C89 / 90)/ 95,或标准附录1.它被集成到C99,尽管一些编译器,如允许你specifiy -std=c94上的命令行。 ISO/IEC 9899:1990/Amd 1:1995 can be purchased for a hefty price from SAI GLOBAL (PDF or hard copy). ISO/IEC 9899:1990/Amd 1:1995 可以从SAI GLOBAL (PDF 或硬拷贝)以高价购买。

A summary of the document can be found here .可以在此处找到该文档的摘要。

When the (then draft) ANSI C Standard was being considered for adoption of an International Standard in 1990, there were several objections because it didn't address internationalization issues.当(当时的草案)ANSI C 标准在 1990 年被考虑采用国际标准时,有几个反对意见,因为它没有解决国际化问题。 Because the Standard had already been several years in the making, it was agreed that a few changes would be made to provide the basis (for example, the functions in subclause 7.10.7 were added), and work would be carried out separately to provide proper internationalization of the Standard.由于该标准已经制定了几年,因此同意进行一些更改以提供基础(例如,增加了第 7.10.7 条中的功能),并将单独开展工作以提供标准的适当国际化。 This work has culminated in Normative Addendum 1.这项工作在规范性附录 1 中达到了高潮。

Normative Addendum 1 embodies C's reaction to both the limitations and promises of international character sets.规范附录 1 体现了 C 对国际字符集的限制和承诺的反应。 Digraphs and the header were meant to improve the appearance of C programs written in national variants of ISO 646 without, eg, { or } characters.有向图和标题旨在改善用 ISO 646 的国家变体编写的 C 程序的外观,没有 { 或 } 字符。 On the other end of the spectrum, the facilities connected to and extend the old Standard's barely adequate basis into a complete and consistent set of utilities for handling wide characters and multibyte strings.另一方面,这些工具连接到旧标准勉强足够的基础并将其扩展为一组完整且一致的实用程序,用于处理宽字符和多字节字符串。

This document summarizes Normative Addendum 1. It is intended to quickly inform readers who are already familiar with the Standard;本文件总结了规范性附录 1。旨在快速通知已经熟悉该标准的读者; it does not, and cannot, introduce the complex subject matter behind NA1, nor can it replace the original document as a reference manual.它没有也不能介绍NA1背后的复杂主题,也不能代替原始文档作为参考手册。 (Nevertheless, it tries to be as accurate as possible, and its author would like to hear about any errors or omissions.) (尽管如此,它会尽可能准确,作者希望了解任何错误或遗漏。)

http://c0x.coding-guidelines.com/ contains a searchable, HTML-based version of the C standard. http://c0x.coding-guidelines.com/包含C标准的基于HTML的可搜索版本。 Actually, a slightly modified version: 实际上,是一个稍微修改的版本:

This web site contains a modified version of N1256. 该网站包含N1256的修改版本。 It includes wording that has been deleted from C99 (ie, in struck through form) and wording that does used to appear in C99 (ie, in underlined form). 它包括已从C99中删除的措辞(即以删除线的形式)和曾经出现在C99中的措辞(即以下划线的形式)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何删除或更改特定要求的C ++标准修订版? - How do I find the revision of C++ standard, where a specific requirement was removed or changed? 在哪里可以找到标准的 Visual C++ 头文件? - Where can I find the standard Visual C++ header files? 如何找到在 C++ 中引发异常的位置? - How do I find where an exception was thrown in C++? C++ 在哪里可以找到 gcc 编译器标准库的实现文件? - C++ where I can find the implementation files of the standard library for the gcc compiler? C ++标准库与凡人制作代码+我在哪里可以找到来源? - C++ standard library vs mortal made code + where can I find the sources? 在哪里可以找到 C++ 语言的标准 BNF 或 YACC 语法? - Where can I find standard BNF or YACC grammar for C++ language? 在c ++中,仅在全局范围内允许使用“表达式”来初始化全局对象。 在标准中哪里可以找到? - In c++, `expressions` are allowed in global scope only to initialize global objects. Where can I find this in the Standard? 我可以在C ++标准中找到在全局范围内调用函数的支持吗? - Where in the C++ Standard can I find support for invoking a function in global scope? 我在哪里可以看到C ++标准库中使用的代码? - Where can I see the code used in C++ standard libraries? C ++-如何找出当前线程的创建位置? - C++ - How can I find out where the current thread was created?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM