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

Re: Book questions



Quoting Gene Heskett (gheskett@wdtv.com):
> 
> 
> On Friday 10 April 2015 10:28:24 Alexis wrote:
> > Having said that, one thing i always felt was sorely lacking in
> > K&R was a more thorough description of pointers. However, i feel
> > that issue has now been addressed by Richard Reese's excellent
> > "Understanding and Using C Pointers":

My goodness, I just googled it, clicked on a link, and found I had
downloaded a copy! Published 2013. Where do they make their money?
(And do I call it the "Piping Crow Book" or will "Crow Book" do?)

> That has never been a problem once you understand that a pointer, even to 
> a 3 or 4 dimmensional array of data, is nothing more, nor less, than the 
> address in memory of the first element of that array. ALL other offsets 
> to other elements in that array are calculated, sometimes in the code 
> issued by the compiler, or occasionally in issueing the code to 
> calculate it on the fly.  Not often done as its a huge speed hit when it 
> does that.

Sigh. You only have to read the first two paragraphs of the reference
for a contradiction of this:

"A solid understanding of pointers and the ability to effectively use
them separates a novice C programmer from a more experienced
one. Pointers pervade the language and provide much of its
flexibility. They provide important support for dynamic memory
allocation, are closely tied to array notation, and, when used to
point to functions, add another dimension to flow control in a
program.

"Pointers have long been a stumbling block in learning C. The basic
concept of a pointer is simple: it is a variable that stores the
address of a memory location. The concept, however, quickly becomes
complicated when we start applying pointer operators and try to
discern their often cryptic notations. But this does not have to be
the case. If we start simple and establish a firm foundation, then the
advanced uses of pointers are not hard to follow and apply."

Cheers,
David.


Reply to: