Comments on Pointers in K&R

Post Comment

Disown said:

K&R is easily one of the best CS/programming books. Short, concise and to the point.

Another way to learn pointers is via assembly. Either learn assembly or just look at the disassembled code. Look under the hood and it'll become clearer.

Of course the best way is to write your own C compiler but that may be overkill for most.

05 Sep 2020 16:35 GMT (#1 of 3 comments)

Microtherion said:

Rather more surprising, at first sight, is the fact that a reference to a[i] can also be written as *(a+i).

I did not find that all that surprising, but the first time I saw that a[i] can also be written as i[a], I was very irritated.

05 Sep 2020 19:54 GMT (#2 of 3 comments)

Diehunde said:

I don't know. I read the pointers chapter at least 3 times, and I still get confused when I see pointer stuff in real code. The other day, I read the famous regex post by Russ Cox, and it took me a couple of hours to understand the pointer parts of the code even though the algorithm behind it was relatively simple. I guess pointers are just one of those things that for some people make a lot of sense, whereas others struggle with.

11 Sep 2020 14:51 GMT (#3 of 3 comments)
Post Comment