在哪里可以找到当前的 C 或 C++ 标准文档?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/81656/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where do I find the current C or C++ standard documents?
提问by Christoffer
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
- C99
- C11
- C++98
- C++03
- C++11
- C++14
- C++17
- C89
- C99
- C11
- C++98
- C++03
- C++11
- C++14
- C++17
回答by Michael Burr
PDF versions of the standard
标准的 PDF 版本
As of 1st September 2014, the best locations by price for C and C++ standards documents in PDF are:
截至 2014 年 9 月 1 日,PDF 格式的 C 和 C++ 标准文档的最佳价格位置是:
- C++17 – ISO/IEC 14882:2017: $116 from ansi.org
- C++14 – ISO/IEC 14882:2014: $90 NZD (about $60 US) from Standards New Zealand
- C++11 – ISO/IEC 14882:2011:
$60 from ansi.org$60 from Techstreet - C++03 – ISO 14882:2003:
$30 from ansi.org$48 from SAI Global C++98 – ISO/IEC 14882:1998: $90 NZD (about $60 US) from Standards New Zealand
C17/C18 – ISO/IEC 9899:2018: $185 from SAI Global/ $116 from INCITS/ANSI/ N2176 / c17_updated_proposed_fdis.pdf draft from November 2017(Link broken, see Wayback Machine N2176)
- C11 – ISO/IEC 9899:2011:
$30$60 from ansi.org/ WG14 draft version N1570 - C99 – ISO 9899:1999:
$30$60 from ansi.org/ WG14 draft version N1256 - C90 – AS 3955-1991:
$141 from ansi.org$175 from Techstreet(the Australian version of C90, identical to ISO 9899:1990) - C90 – 9899:1990 Hardcopy available from SAI Global ($88 + shipping)
- C++17 – ISO/IEC 14882:2017:ansi.org 116 美元
- C++14 – ISO/IEC 14882:2014:90 新西兰元(约合 60 美元)来自新西兰标准
- C++11 – ISO/IEC 14882:2011:
ansi.org60美元,Techstreet60 美元 - C++03 – ISO 14882:2003:
ansi.org 30美元 SAI Global 48 美元 C++98 – ISO/IEC 14882:1998:新西兰标准 90 新西兰元(约合 60 美元)
C17/C18 – ISO/IEC 9899:2018:185 美元来自 SAI Global/ 116 美元来自 INCITS/ANSI/ N2176 / c17_updated_proposed_fdis.pdf 2017 年 11 月草案(链接已断开,请参阅Wayback Machine N2176)
- C11 – ISO/IEC 9899:2011:
$30$60 from ansi.org/ WG14 草案版本 N1570 - C99 – ISO 9899:1999:来自 ansi.org/ WG14 草案版本 N1256
30美元 60 美元 - C90 – AS 3955-1991:ansi.org
141 美元 Techstreet175 美元(C90 的澳大利亚版,与 ISO 9899:1990 相同) - C90 – 9899:1990硬拷贝可从 SAI Global 获得(88 美元 + 运费)
You cannot usually get old revisions of a standard (any standard) directly from the standards bodies shortly after a new edition of the standard is released. Thus, standards for C89, C90, C99, C++98, C++03 will be hard to find for purchase from a standards body. If you need an old revision of a standard, check Techstreetas one possible source. For example, it can still provide the Canadian version CAN/CSA-ISO/IEC 9899:1990 standard in PDF, for a fee.
在标准的新版本发布后不久,您通常无法直接从标准机构获得标准(任何标准)的旧版本。因此,很难从标准机构购买 C89、C90、C99、C++98、C++03 的标准。如果您需要标准的旧版本,请检查Techstreet作为一个可能的来源。例如,它仍然可以提供 PDF 格式的加拿大版本 CAN/CSA-ISO/IEC 9899:1990 标准,但需要付费。
Non-PDF electronic versions of the standard
标准的非 PDF 电子版本
- C89 – Draft version in ANSI text format: (https://web.archive.org/web/20161223125339/http://flash-gordon.me.uk/ansi.c.txt)
- C90 TC1; ISO/IEC 9899 TCOR1, single-page HTML document: (http://www.open-std.org/jtc1/sc22/wg14/www/docs/tc1.htm)
- C90 TC2; ISO/IEC 9899 TCOR2, single-page HTML document: (http://www.open-std.org/jtc1/sc22/wg14/www/docs/tc2.htm)
- C89 – ANSI 文本格式的草案版本:(https://web.archive.org/web/20161223125339/http://flash-gordon.me.uk/ansi.c.txt)
- C90 TC1; ISO/IEC 9899 TCOR1,单页 HTML 文档:(http://www.open-std.org/jtc1/sc22/wg14/www/docs/tc1.htm)
- C90 TC2;ISO/IEC 9899 TCOR2,单页 HTML 文档:(http://www.open-std.org/jtc1/sc22/wg14/www/docs/tc2.htm)
Print versions of the standard
标准的印刷版本
Print copies of the standards are available from national standards bodies and ISObut 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 Standardat 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(英国标准协会)以书籍形式获得:
- C++03 Standardon Amazon
- C99 Standardon Amazon
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:
ANSI X3.159-198 (C89):
I cannot find a PDF of C89, but it is almost the same as the below draft for ISO/IEC 9899:1990 (C90). The only differences are in the boilerplate and section numbering.
ISO/IEC 9899:1990 (C90):
https://www.pdf-archive.com/2014/10/02/ansi-iso-9899-1990-1/ansi-iso-9899-1990-1.pdf
(Almost the same as ANSI X3.159-198 (C89) except for the frontmatter and section numbering. Note that the conversion between ANSI and ISO/IEC Standard is seen inside this document, the document refers to its name as "ANSI/ISO: 9899/99" although this isn't the right name of the later made standard of it, the right name is "ISO/IEC 9899:1990")
ISO/IEC 9899:1999 (C99):
ISO/IEC 9899:2011 (C11):
ISO/IEC 9899:2018 (C18):
ANSI X3.159-198 (C89):
我找不到 C89 的 PDF,但它与 ISO/IEC 9899:1990 (C90) 的以下草案几乎相同。唯一的区别在于样板和部分编号。
ISO/IEC 9899:1990 (C90):
https://www.pdf-archive.com/2014/10/02/ansi-iso-9899-1990-1/ansi-iso-9899-1990-1.pdf
(几乎与ANSI X3.159-198(C89)相同,除了frontmatter和section编号。注意ANSI和ISO/IEC标准之间的转换在本文档中可见,该文档将其名称称为“ANSI/ISO : 9899/99" 虽然这不是后来制定的标准的正确名称,但正确的名称是 "ISO/IEC 9899:1990")
ISO/IEC 9899:1999 (C99):
ISO/IEC 9899:2011 (C11):
ISO/IEC 9899:2018 (C18):
For C++:
对于 C++:
ISO/IEC 14882:1998 (C++98):
http://www.lirmm.fr/~ducour/Doc-objets/ISO+IEC+14882-1998.pdf
ISO/IEC 14882:2003 (C++03):
https://cs.nyu.edu/courses/fall11/CSCI-GA.2110-003/documents/c++2003std.pdf
ISO/IEC 14882:2011 (C++11):
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf
ISO/IEC 14882:2014 (C++14):
https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf?raw=true
ISO/IEC 14882:2017 (C++17):
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf
ISO/IEC 14882:1998 (C++98):
http://www.lirmm.fr/~ducour/Doc-objets/ISO+IEC+14882-1998.pdf
ISO/IEC 14882:2003 (C++03):
https://cs.nyu.edu/courses/fall11/CSCI-GA.2110-003/documents/c++2003std.pdf
ISO/IEC 14882:2011 (C++11):
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf
ISO/IEC 14882:2014 (C++14):
https://github.com/cplusplus/draft/blob/master/papers/n4140.pdf?raw=true
ISO/IEC 14882:2017 (C++17):
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf
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; you need to be on the standards committee to get them.
请注意,这些文件与标准不同,尽管会议之前决定标准的版本通常与最终标准中的版本非常接近。FCD(最终委员会草案)版本受密码保护;你需要加入标准委员会才能得到它们。
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. By doing so, one of this post's editors was able to find the C11 and C++11 standards at reasonable prices. For example, if you search for "INCITS/ISO/IEC 9899:2011" instead of "ISO/IEC 9899:2011" on webstore.ansi.orgyou will find the reasonably priced PDF version.
看来,如果您愿意并且能够在标准批准后等待几个月,那么在寻找标准时搜索“INCITS/ISO/IEC”而不是“ISO/IEC”是关键。通过这样做,本文的一位编辑能够以合理的价格找到 C11 和 C++11 标准。例如,如果您在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 链接:
- https://wg21.link/std11- C++11
- https://wg21.link/std14- C++14
- https://wg21.link/std17- C++17
- https://wg21.link/std- current working draft
- https://wg21.link/std11- C++11
- https://wg21.link/std14- C++14
- https://wg21.link/std17- C++17
- https://wg21.link/std- 当前工作草案
The current draft of the standard is maintained as LaTeX sources on Github. These sources can be converted to HTML using cxxdraft-htmlgen. The following sites maintain HTML pages so generated:
该标准的当前草案在Github上作为 LaTeX 源进行维护。可以使用cxxdraft-htmlgen将这些源转换为 HTML 。以下站点维护如此生成的 HTML 页面:
- Tim Song - Current working draft- C++11- C++14- C++17
- Eelis - Current working draft
Tim Songalso maintains generated HTML and PDF versions of the Networking TS and Ranges TS.
Tim Song还维护生成的 HTML 和 PDF 版本的 Networking TS 和 Ranges TS。
回答by Martin York
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)
2020-01-14: N4849git
2019-11-27: N4842git
2019-10-08: N4835git
2019-08-15: N4830git
2019-06-17: N4820git
2019-03-15: N4810git
2019-01-21: N4800git
2018-11-26: N4791git
2018-10-08: N4778git
2018-07-07: N4762git
2018-05-07: N4750git
2018-04-02: N4741git
2018-02-12: N4727git
2017-11-27: N4713git
2017-10-16: N4700git
2017-07-30: N4687git
以下是标准的所有草案版本:以下所有版本
均可免费下载
(其中许多可在此主要 GitHub 链接中找到)
2020-01-14:N4849 git
2019-11-27:N4842 git
2019-10-08:N4835的Git
2019年8月15日:N4830的git
2019年6月17日:N4820的git
2019年3月15日:N4810的git
2019年1月21日:N4800的git
2018年11月26日:N4791的git
2018年10月8日:N4778混帐
2018-07-07:N4762 git
2018-05-07:N4750的Git
2018年4月2日:N4741的git
2018年2月12日:N4727的git
2017年11月27日:N4713的git
2017年10月16日:N4700的git
2017年7月30日:N4687混帐
This seems to be the new standard:
These version requires Authentication
2017-03-21: N4660is 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: N4659git
2017-02-06: N4640git
2016-11-28: N4618git
2016-07-12: N4606git
2016-05-30: N4594git
2016-03-19: N4582git
2015-11-09: N4567git
2015-05-22: N4527git
2015-04-10: N4431git
2014-11-19: N4296git
以下标准的所有版本草案:
以下所有条件都可以免费下载
2017年3月21日:N4659的git
2017年2月6日:N4640的git
2016年11月28日:N4618的git
2016年7月12日:N4606的git
2016-05 -30:N4594的git
2016年3月19日:N4582的git
2015年11月9日:N4567的git
2015年5月22日:N4527的git
2015年4月10日:N4431的git
2014年11月19日:N4296 GIT中
This seems to be the old C++14 standard:
These version requires Authentication
2014-10-07: N4140gitEssentially C++14 with minor errors and typos corrected
2014-09-02: N4141gitStandard C++14
2014-03-02: N3937
2014-03-02: N3936git
这似乎是旧的 C++14 标准:
这些版本需要身份验证
2014-10-07:N4140 git本质上是 C++14,有小错误和拼写错误更正
2014-09-02:N4141 gitStandard C++14
2014- 03-02:N3937
2014-03-02:N3936 git
The following all draft versions of the standard:
All the following are freely downloadable
2013-10-13: N3797git
2013-05-16: N3691
2013-05-15: N3690
2012-11-02: N3485
2012-02-28: N3376
2012-01-16: N3337gitEssentially C++11 with minor errors and typos corrected
以下所有标准草案版本:
以下所有内容均可免费下载
2013-10-13:N3797 git
2013-05-16:N3691
2013-05-15:N3690
2012-11-02:N3485
2012-02-2N3376
2012-01-16:N3337 git本质上是 C++11,修正了小错误和拼写错误
This seems to be the old C++11 standard:
This version requires Authentication
2011-04-05: N3291C++11 (Or Very Close)
这似乎是旧的 C++11 标准:
此版本需要身份验证
2011-04-05:N3291C++11(或非常接近)
The following all draft versions of the standard:
All the following are freely downloadable
2011-02-28: N3242(differences from N3291 very minor)
2010-11-27: N3225
2010-08-21: N3126
2010-03-29: N3090
2010-02-16: N3035
2009-11-09: N3000
2009-09-25: N2960
2009-06-22: N2914
2009-03-23: N2857
2008-10-04: N2798
2008-08-25: N2723
2008-06-27: N2691
2008-05-19: N2606
2008-03-17: N2588
2008-02-04: N2521
2007-10-22: N2461
2007-08-06: N2369
2007-06-25: N2315
2007-05-07: N2284
2006-11-03: N2134
2006-04-21: N2009
2005-10-19: N1905
2005-04-27: N1804
以下所有标准草案版本:
以下所有内容均可免费下载
2011-02-28:N3242(与 N3291 的差异很小)
2010-11-27:N3225
2010-08-21:N3126
2010-03-20:N30
2010-02-16:N3035
2009-11-09:N3000
2009-09-25:N2960
2009-06-22:N2914
2009-03-23:N2857
2008-10-04:N2798
2008-08-25:N2723
2008 -06-27:N2691
2008-05-19:N2606
2008-03-17:N2588
2008-02-04:N2521
2007-10-22:N2461
2007-08-06:N2369
2007-06-25:N2315
2007-05-07:N2284
2006-11-03:N2134
2006-04-21:N2009
2005-10-19:N1905
2005 -04-27:N1804
This seems to be the old C++03 standard:
All the below versions require Authentication
2004-11-05: N1733
2004-07-16: N1655Unofficial
2004-02-07: N1577C++03 (Or Very Close)
2001-09-13: N1316Draft Expanded Technical Corrigendum
1997-00-00: N1117 Draft Expanded Technical Corrigendum
这似乎是旧的 C++03 标准:
以下所有版本都需要身份验证
2004-11-05:N1733
2004-07-16:N1655非官方
2004-02-07:N1577C++03(或非常接近)
2001 -09-13:N1316扩展技术勘误
草案 1997-00-00:N1117 扩展技术勘误草案
The following all draft versions of the standard:
All the following are freely downloadable
1996-00-00: N0836Draft Expanded Technical Corrigendum
1995-00-00: N0785 Working Paper for Draft Proposed International Standard for Information Systems - Programming Language C++
以下所有标准草案版本:
以下所有内容均可免费下载
1996-00-00:N0836扩展技术勘误草案
1995-00-00:N0785 信息系统国际标准草案的工作文件 - 编程语言 C++
Other Interesting Papers:
其他有趣的论文:
回答by Christoffer
C99 is available online. Quoted from www.open-std.org:
C99可在线获得。引自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. This is a WG14 working paper, but it reflects the consolidated standard at the time of issue.
该标准的最新公开版本是组合 C99 + TC1 + TC2 + TC3,WG14 N1256,日期为 2007-09-07。这是 WG14 工作文件,但它反映了发布时的合并标准。
回答by user1055604
Draft Links:
草稿链接:
C++11 (+editorial fixes): N3337 HTML, PDF
C++14 (+editorial fixes): N4140 HTML, PDF
C99 N1256
C99 N1256
Draftsof the Standard are circulated for comment prior to ratification and publication.
Notethat a working draft is not the standard currently in force, and it is not exactly the published standard
在批准和出版之前,标准的草案将被分发以征求意见。
请注意,工作草案不是当前生效的标准,也不完全是已发布的标准
回答by James Hopkin
You might find the draft international standardfor C++0x useful.
您可能会发现C++0x 的国际标准草案很有用。
回答by Pieter
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.
然而,虽然它们还没有最终确定,但它们通常可以在网上找到,作为草稿。大多数情况下,最终版本与上一稿没有太大区别,因此虽然不完美,但它们很适合。
回答by Anthony Williams
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.
回答by MSalters
The ISO C and C++ standards are bloody expensive. On the other hand, the INCITS republishes them for a lot less. http://www.techstreet.com/seems to have the PDF for $30 (search for INCITS/ISO/IEC 14882:2003).
ISO C 和 C++ 标准非常昂贵。另一方面,INCITS 重新发布它们的价格要低得多。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 出版的英国标准协会版本。
回答by jxh
The text of a draft of the ANSI C standard(aka C.89) is available online. 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.
ANSI C 标准(又名 C.89)草案的文本可在线获取。在被 ISO C 标准 (C.90) 接受之前,这是由 ANSI 委员会标准化的,因此各节的编号不同(ANSI 第 2 至 4 节大致对应于 ISO 第 5 至 7 节),尽管内容是(假设是)在很大程度上相同。
回答by Kris Kumler
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.
实际的标准文件可能不是最有用的。大多数编译器并没有完全实现标准,有时可能会发生实际冲突。因此,您已经拥有的编译器文档将更有用。此外,该文档将包含特定于平台的备注和有关任何警告的注释。