[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Book questions


On Tue, Apr 14, 2015 at 02:16:40AM +0800, Bret Busby wrote:
> On 14/04/2015, Reco <recoverym4n@gmail.com> wrote:
> > On Tue, Apr 14, 2015 at 12:36:28AM +0800, Bret Busby wrote:
> >> On 13/04/2015, Reco <recoverym4n@gmail.com> wrote:
> >>
> >> <snip>
> >>
> >> >Learning C is simple and
> >> > fun. Just read classic K&R treatise, do all the examples. Did so back
> >> > in
> >> > high school, and no brain was damaged in the process :)
> >> > The only problem today is to get a C compiler that understands K&R C.
> >> >
> >>
> >> I have not programmed in "C" for about 20-25 years, now, but, from
> >> memory, with compilers, like "C" compilers, don't they have a switch
> >> that can be set,  so that they accept only ANSI code, such as ANSI
> >> "C"?
> >
> > *ANSI* C - yes. For instance, gcc has this wonderful '-ansi' switch.
> > It's even possible to choose the exact version of ANSI C standard (i.e.
> > -std=c99).
> > *K&R* C - no. At least, gcc-4.7 has no switch for this that I'm
> > aware of.
> >
> Okay - this is where the detail of the Kernighan & Ritchie book, is required.
> You see, when I searched for "C" books, at amazon, I found at
> http://www.amazon.com/The-Programming-Language-Brian-Kernighan/dp/8120305965/ref=pd_sim_b_1?ie=UTF8&refRID=02E2S6076Y4MYDCXP9RE
> So, the second edition, published in 1988, included ANSI "C", and, the
> picture of the from cover of the book, has a big stamp on it; "ANSI
> C".

That's something that I didn't know. And that means that back in 1994
they gave me first edition of the book :) Not that it stopped me from
reading it or trying the things they put in there.

> So, it really depends on, if the original poster obtains, or, obtains
> access to, a copy of the text "The C Programming Language" by
> Kernighan and Ritchie, whether he gets a copy that is the second
> edition (1988) or later.
> If he gets a copy that is the second edition (1988), or later, then it
> should be ANSI "C".

The only suspicious thing is - the oldest ANSI C standard that I'm aware
of is C89. Sure, K&R could use a draft of ANSI C standard in the second
edtition, but still...

> When I was learning "C", I found the (then available) Sam's Waite
> Group "C" Bible to be a brilliant reference manual, as it was a
> brilliant language reference manual.
> But, a reference manual, and, a teaching course, are two different things.

Sure. That's why I'd like to add this:


The book assumes that you know the basics, and focuses on the ways of
using them right way (makefiles, pkg-config, that stuff). Good reading.


Reply to: