“When Arrays Are Pointers The C standard has the following to say about the matter. Rule 1. An array name in an expression (in contrast with a declaration) is treated by the compiler as a pointer to the first element of the array1 (paraphrase, ANSI C Standard, paragraph 6.2.2.1). 1. OK nitpickers, there are a few minuscule exceptions that concern arrays treated as a whole. A reference to an array is not replaced by a pointer to the first element when: • the array appears as the operand of sizeof()—-obviously you want the size of the whole array here, not just a pointer to it. • the array’s address is taken with the & operator. • the array is a string or wide-string literal initializer. Rule 2. A subscript is always equivalent to an offset from a pointer (paraphrase, ANSI C Standard, paragraph 6.3.2.1). Rule 3. An array name in the declaration of a function parameter is treated by the compiler as a pointer to the first element of the array (paraphrase, ANSI C Standard, paragraph 6.7.1).”
―
Expert C Programming: Deep Secrets
Share this quote:
Friends Who Liked This Quote
To see what your friends thought of this quote, please sign up!
0 likes
All Members Who Liked This Quote
None yet!
This Quote Is From
Browse By Tag
- love (101361)
- life (79364)
- inspirational (75821)
- humor (44329)
- philosophy (30960)
- inspirational-quotes (28876)
- god (26865)
- truth (24736)
- wisdom (24615)
- romance (24340)
- poetry (23283)
- life-lessons (22584)
- quotes (20991)
- travel (20583)
- death (20529)
- happiness (18973)
- hope (18531)
- faith (18388)
- inspiration (17293)
- spirituality (15702)
- relationships (15521)
- religion (15376)
- motivational (15307)
- life-quotes (15292)
- love-quotes (15138)
- writing (14935)
- success (14185)
- motivation (13162)
- time (12863)
- motivational-quotes (12141)

