9. More about Arrays
Never eat at a place called “Mom’s.” Never play cards with a man called “Doc.”
And never, ever, forget that C treats an l-value of type array-of-T in an expression as a pointer to the first element of the array.
—C programmers’ saying (Traditional)
when an array is a pointer...why the confusion?...an “array name in anexpression” is a pointer...why C treats array subscripts as pointeroffsets...an “array name as a function parameter” is a pointer...why C treats array parameters as pointers...how an array parameter isreferenced...indexing a slice...arrays and pointers interchangeabilitysummary...C has multi-dimensional arrays...but every other languagecalls them “arrays of arrays”...how arrays are laid out in memory...how to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access