有没有类似官方 C 文档的东西?

我正在寻找 C 语言中所有语法和内置函数的文档,但我找不到任何在线网站,看起来像 标准 C 知识的最终官方来源

除了 Kernighan 和 Ritchie 的著作之外,难道没有任何在线 C 规范吗?也许有,但我不知道怎么找到。也许问题在于我不知道自己在找什么。

59805 次浏览

Strictly speaking, the C standard is not available for free. You need to purchase an electronic copy from http://www.ansi.org/ or http://www.iso.org.

However, you can download a free draft version from the Open Standards Organization's website - this is as good as or better than the official standard itself. It incorporates information from the ISO C99 standard plus three Technical Corrigenda, all of which are official ISO documents.

More info here: http://c-faq.com/ansi/avail.html

There're various C standard specifications.

See C's history on wikipedia for example.

When we talk about standard C these days, we mostly refer to the ANSI C Standard.

Here's a link to the standard in textform: http://flash-gordon.me.uk/ansi.c.txt

If what you want is the documentation for the standard library functions, then P.J. Plauger's "The Standard C Library" http://www.amazon.com/Standard-C-Library-P-J-Plauger/dp/0131315099/ref=sr_1_1?s=books&ie=UTF8&qid=1290273108&sr=1-1 is the best reference. It's got pretty extensive annotation and comentary on the why and how of the standard.

C is an ISO standardised language. Current specification is ISO/IEC 9899:1999 standard a.k.a. C99.

You can obtain a PDF copy of the C99 standard (ISO/IEC 9899:1999) from ANSI (and other fine standards organizations) for your private use for a modest fee - I believe it was 18 USD when I bought mine. Having that available is invaluable to me. But if you find a copy in public, then it is contraband.

You can find final committee drafts and current working documents of the C (C0x) Standard Committee at the JTC1, SC22, WG14 web site at the Open Standards Organization. (That's Joint Technical Committee 1, Sub-Committee 22, Working Group 14, I believe).

There is also a hardback book 'The C Standard: Incorporating Technical Corrigendum 1' (also including the Rationale) available for a slightly less modest 85 USD or thereabouts.

One of the best books about C is 'C: A Reference Manual' in its fifth edition. However, you asked for 'ultimate official source of standard C knowledge', and the only 'official' such source is the C standard, plus its corrigenda.

See also the material at http://www.coding-guidelines.com/ and http://c0x.coding-guidelines.com/.

The official C99 standard is available for purchase from your national standards body; however, in practice everyone reads the draft with post-1999 corrections/amendments included, which you can download for free:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf

Is there something like the official C documentation?

The most official documentation is the ISO standard, to which compilers are written and are expected to interpret correctly.

C99 Standard

Here's the latest Committee draft on the C99 Standard, last updated April 12, 2011:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf

I'll try to keep it up to date with the latest version as I can.

Kernighan & Ritchie

I also found K&R's text, second edition, here: http://www.ime.usp.br/~pf/Kernighan-Ritchie/C-Programming-Ebook.pdf

However, I'd use the -Wall flag when compiling the examples in the book so that you don't get led too far astray by the age of the text.

You can refer GNU C documentation at https://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html

Specifically, this manual aims to document:

  1. The 1989 ANSI C standard, commonly known as “C89”
  2. The 1999 ISO C standard, commonly known as “C99”, to the extent that C99 is implemented by GCC
  3. The current state of GNU extensions to standard C

https://msdn.microsoft.com/en-us/library/fw5abdx6.aspx The "C Language Reference" describes the C programming language as implemented in Microsoft C. The book's organization is based on the ANSI C standard with additional material on the Microsoft extensions to the ANSI C standard.

There is this online website devdocs

They have multiple API documentations which are well organized. It is free and open-source.

For c doc click this link http://devdocs.io/c/