int array[4] array == &array ? [C++]

Started by
1 comment, last by DevFred 15 years, 11 months ago
For: int array[4]; I had always thought: array was the address of the first array element, and &array was invalid syntax. However they both seem to compile, and be the address, as notified to me by a co-worker. I can kind of see why the second case works, as "array" is a static array, and thus & takes the address of that object. Still... subtle. :) Thought I would bring it up in case anyone else hadn't noticed this.
--== discman1028 ==--
Advertisement
You might find this an interesting read.
FAQ

This topic is closed to new replies.

Advertisement