Error in tutorial

This isn't an error exactly, but it implies something that is.

On the 'Pointers' page in the tutorial, under section 'Pointers and Arrays', the code section and the text before it seems to imply that you can't assign values to the addresses pointed at by 'numbers' using pointer syntax because it's an array, and therefore constant. You can't change what it points to, but you can dereference it and assign values to it just like 'p'.

p = numbers + 3; *p = 40;
works just as well as
*(numbers + 3) = 40;

And
p = numbers; *(p+4) = 50;
works just as well as
*(numbers + 4) = 50;

It seems misleading for new learners.

I cannot find any way to contact the site owner anywhere, so.. I'll just post it here.
Dude, there is a way to contact them.
If you scroll down the the bottom of the page (using the scroll bar) you'll find a "Spotted an error? contact us" link.
If you cannot find it just click the link provided below:

http://www.cplusplus.com/contact.do?referrer=http%3A%2F%2Fwww.cplusplus.com%2Fforum%2Fbeginner%2F
Thanks, dude.
I disagree with your assessment. The very last part of that section explains exactly how arrays are dereferenced, directly contradicting any idea that an array's content is not mutable. I also think that the text itself is sufficiently clear that it is the 'numbers' pointer that is const, and not the that 'numbers' references.
I agree with Duoas. The text makes the difference between numbers the pointer and numbers the array and their respective constnesses sufficiently clear, IMO.
Topic archived. No new replies allowed.