Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: [Solved] Need some help getting to my feet Date: Fri, 27 Apr 2018 11:06:04 -0700 Organization: None to speak of Lines: 58 Message-ID: References: <0db1659a-6249-47d0-8fab-baf080d32f76@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="cc0e2a6c7d0567601a378dba59302632"; logging-data="15372"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186jBhEWCp8DWzG823jpvQq" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:84KGPg6hRCrVMjF75Ng1QxHpgtU= sha1:luT8lsC3es7hAuip11fNNYjBtfY= Xref: csiph.com comp.lang.c:129867 Dan Purgert writes: > already5chosen@yahoo.com wrote: [...] >> It is not good a style guide and not even good as language reference, >> unless you want to ignore everything that was added to the language in >> C99 and C11. > > Right now, April 27th 2018, I really don't care about the differences > between pre-ANSI K&R C (C78?), ANSI K&R2 C (C89?), C99, C11, or any > other variants thereto. I just need to get back on my feet as it were > with C programming in general. K&R1 is only of historical interest. K&R2 is mainly a tutorial, not a reference, though it does have a reference section at the end. The difference between pre-ANSI K&R C and C89/C90 is substantial, and pre-ANSI C is almost entirely obsolete. Function prototypes are probably the most significant change. If you want to learn C, I suggest not spending time on anything older than so-called "ANSI C". The term "ANSI C" is actually a misnomer, for reasons I won't get into. It's best to refer the editions by year: C89/C90 (both the same language), C99, and C11. And since 1990 the official standard has been published by ISO, not ANSI, so ISO C90 is the most precise term for the language described in K&R2. As for the three editions of the standard (1989 ANSI and 1990 ISO describe the same language), you can write valid C90 code and, with very few exceptions, it will be valid C99 and valid C11. If you don't need the newer features, you don't have to use them. In my opinion, you can get a good start learning the language from K&R2 (if you have some existing programming experience). You can pick up the changes made by C99 and C11 later on. I think some examples in K&R2 use "implicit int", and as I recall that's addressed in the errata. Always declare and define functions with an explicit return type. The definitive reference is the standard itself; I mentioned the N1570 draft upthread. Grab a copy (it's a 1.6 MB PDF) and take a quick look. If you find the writing too dense, don't worry about it; just set it aside and perhaps come back to it later. [...] > Thought about grabbing K&R(1), but that seems to be about as easy to > find as hens teeth. Yeah, I bought my copy in 1981. I don't even know how long it's been out of print. But you can still find reasonably priced used copies through online book sellers. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"