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 ...
Get Expert C Programming now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.