Stewart Stremler wrote:
I've always read that "array references decompose into pointers", which
is not the same thing as "arrays are always pointers".

Quite correct.  Very different.

I suggest "Expert C Programming" by Peter Van Der Linden.

Chapter 4.  The Shocking Truth: C Arrays and Pointers are NOT the Same!

Wouldn't compiling a tiny fraction of code to assembly be a quick way
to demonstrate this?

We await your demonstration ...

The reason why I point to Van Der Linden in esoteric C discussions is that he talks about more cases than you generally think of directly. In this instance he talks about the difficulties which arise when you declare as array while making a define as pointer and vice versa.

Given he has 3 entire chapters about pointers and arrays (Chapter 9 is devoted to when you *can* use pointers and arrays interchangeably), I couldn't possibly remember all the cases. In fact, I had to wait on responding until I got home and could look things up.

-a


--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to