Quick question about the value of an array.

Here's a quickie:

The code below (from Learncpp.com) assigns an array dynamically via a pointer. Then the line below set's the value of the array to 3.

But what does this mean? How can an array containing 10 elements = 3?

3 what?

Sorry for being so dense! :)

1
2
int *panData = new int[10];
panData[5] = 3;
Last edited on
set's the value of the array to 3.
It does not. It sets value of element with index 5 to 3.
ah, stoopid me, sorry, thanks!
Topic archived. No new replies allowed.