Func returning array
<p>Please, help me with such common task as to write function that must return array. I spent 2 hours with solving this problem, but no results. Here is my code:</p>

<pre><code> VERTEX* ConstructVertices(float R, unsigned int Slices)
{
    //const unsigned int n = static_cast&lt;const unsigned int&gt;(Slices);
    VERTEX *__vertices = new VERTEX[100];

    float dx = (2 * R) / Slices;
    float dz = dx;
    float x, y, z;
    x = -R;
    y = 0.5f;
    z = 0;
    int x_sign = 1;
    int z_sign = -1;

    __vertices[0].Color = D3DXCOLOR(0.0f, 1.0f, 0.0f, 1.0f);
    __vertices[0].Pos = D3DXVECTOR3(x, y, z);

    for (int i=1; i&lt;Slices * 4 + 1; i++)
    {
        __vertices[i].Color = D3DXCOLOR(0.0f, 1.0f, 0.0f, 1.0f);

        y = -y;

        if (y &lt; 0)
        {
            __vertices[i].Pos = D3DXVECTOR3(x, y, z);
            continue;
        }

        x += x_sign * dx;
        z += z_sign * dz;

        x = round_up(x, 2);
        z = round_up(z, 2);

        if (abs(x) == abs(R))
        {
            x_sign = -x_sign;
        }
        if (abs(z) == abs(R))
        {
            z_sign = -z_sign;
        }

        __vertices[i].Pos = D3DXVECTOR3(x, y, z);   
    }

    return __vertices;
}
</code></pre>

<p>Code for accessing the array:</p>

<pre><code>VERTEX *vertices = new VERTEX[100];
vertices = ConstructVertices(1, 10);
</code></pre>

<p>With Watches window i can see values like vertices[0], vertices[1],.. But i can't see it as an array &amp; the main is sizeof(vertices) returns 4 instead of 160!!</p>

<p>Thank a lot!</p>
