-1

I'm new to c programming language and I come from a java/python background.

For java, the official documents is available at Java SE 8.

For python, the official documents is available at python.org

But after a bit of google, it seems that C does not have a similar official documentation as such. e.g. I can't find the official documentation on malloc() function, even though a very good explanation/documentation can be found at cppreference.com. From what I know, there are the offical ANSI/ISO documentations available via purchase (which are more tailored for compiler writers), but there does not seem to be any documentations like the one available for java/python.

Could someone point me to the right direction? If there is indeed no such OFFICIAL documentation available, could someone tell me why is this the case? (cause its not hard to imagine that having official documentation freely available to the public would be very valuable to every c developer)

Thor
  • 9,638
  • 15
  • 62
  • 137
  • Search for n1570. Chapter 7. – pablo1977 Aug 01 '17 at 04:25
  • hi @taskinoor, I dont think my question is a duplicate because in addition, I'm asking why c programming language does not have similar styled documentation like java/python. – Thor Aug 01 '17 at 04:26
  • [Pre-publication draft of the C 2011 standard](http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf). The *official* standard costs money, but the pre-publication drafts are generally available online. – John Bode Aug 01 '17 at 04:33
  • @JohnBode if I may ask a question that may seem somewhat naive to you, does the official standard contain explanation to functions such as `malloc()` etc? Cause I have never read the standard before and I dont want to spend money on something that is irrelevant – Thor Aug 01 '17 at 04:37
  • 1
    @CaptainAmerica: Yes, it describes all the functions in the standard library (section 7). The online draft is free to access, and for most cases is good enough to act as a reference (pre-pub drafts may contain minor typos or other small errors). – John Bode Aug 01 '17 at 11:46
  • @JohnBode thanks for the advice! really appreciate it! – Thor Aug 01 '17 at 12:59

1 Answers1

3

C covers a huge codebase, and has no single big repo or reference release. If you are using Unix, "man" for any function gives you copious doc on that and related functions/data structures. The POSIX "C" standard covers a large swatch: browse https://en.wikipedia.org/wiki/C_POSIX_library. Beyond that ... github? :-)

Mischa
  • 2,240
  • 20
  • 18
  • hi @Mischa, thank you very much for the answer. I was wondering, let's say you want to look up a function named `malloc()`, what would your search strategy be? Could you please give me a brief indication as to what you would do? Any help would be much appreciated! – Thor Aug 01 '17 at 04:38
  • 1
    just googling :) http://www.cplusplus.com/reference/cstdlib/malloc/ –  Aug 01 '17 at 06:09
  • Or Google `man malloc` – Mischa Aug 01 '17 at 15:33