Question: Looks like a very dumb question:
Here is how an array pointer is declared:

```
double * y = new double[26];

```

After this declaration, I watched y when the program was running, and here is what I have seen:

```
name    value
y[224] 8.691694942331e-310#DEN
y[225] CXX0030: Error: Expression cannot be evaluated

```

So I am wondering why a double array declared with 26 length has 224 elements? Thanks.

Edit:
But I tried this code, and it went through!

```
int nPt = 26;
double * y = new double[nPt];
y[224] = 0;

```

If there is no y[224], how it is possible its value is assigned?

Answer: 
> 
> So I am wondering why a double array declared with 26 length has 224 elements?
> 
> 
> 

It doesn't. Your debugger can't seem to figure out that `y` only has 26 elements.

> 
> But I tried this code, and it went through!
> 
> 
> 

```
int nPt = 26;
double * y = new double[nPt];
y[224] = 0;

```

The code has [undefined behaviour](http://en.wikipedia.org/wiki/Undefined_behavior). This doesn't mean it has to crash; it is free to fail (or not) in any way it pleases.
Arrays don't exists in C/C++. In fact, an expression like t[i] is just a short cut (a syntactic sugar) to say I want to access the i-th memory location beyond address t. When you allocate a memory chunk with new and size N (new int[N]), the system gave you an address from which it is safe to access N memory location from the returned address (beware that when I said N memory location, it is not N bytes, but N\*sizeof\_one\_element\_in\_bytes). But C/C++ lets you calculate any address derived from the one returned, it is up to you to ensure that you don't access bad addresses. C/C++ runtime knows nothing about arrays sizes, it can't protect you from this kind of error. C/C++ pointers are very much error-prone, you must be very careful using it. That is the price to pay to be close to the machine and/or efficient.