cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
does a higher index mean a higher pointe
does a higher index mean a higher pointer value?
Jun 15, 2011 at 1:20am UTC
ausairman
(308)
Quick conceptual question; if I have an array arr, is the following always true?
if
a > b
, then
&arr[a] > &arr[b]
Jun 15, 2011 at 1:24am UTC
firedraco
(6243)
Yes.
&arr[a] == &*(arr+a) == (arr+a);
Jun 15, 2011 at 1:26am UTC
shacktar
(1187)
That's why getting the address of the first element/pointer arithmetic work over arrays.
Jun 15, 2011 at 1:35am UTC
ausairman
(308)
Makes sense, thanks!
Topic archived. No new replies allowed.