C++ pointer help
<pre><code>    #include &lt;iostream&gt;
    using namespace std;


    struct InvRec   
        {
        int PartID;
        float Price;
        int Warehouse;
        };

    typedef InvRec *InvRecptr;  
    typedef InvRec arr[];

    typedef InvRecptr * indexarr;

    void deallocate (indexarr &amp; ptrs, int &amp; size)

    {
        for (int i=0; i&lt;size; i++) delete (ptrs[i]);
        delete ptrs;
        ptrs = NULL;
        size = 0;
    };
int getRecordCount();






void main ()
{

    char YN;

    cout &lt;&lt; "press a key, at creation";
    cin &gt;&gt; YN;
    InvRecptr *InvRecArray = new InvRecptr[10];

    for (int i = 0; i &lt; 10; i++)
    {
        InvRecArray[i]-&gt;PartID = i;

        cout &lt;&lt; "\n i = " &lt;&lt; i &lt;&lt; "\n";
    }
};
</code></pre>

<p>the porgram works if the first line in the for loop of main "InvRecArray[i]->PartID = i;
" is commented out but crashes otherwise</p>
