how can i access to a byte array of array of different size?
<p>i facing a problem when i try to access to an array of array with a pointer, i have several arrays declared as following :</p>

<pre><code>BYTE a[5] = {0xcc,0xaa,0xbb,0xcc,0xff};
BYTE b[3] = {0xaa,0xbb,0xff};
</code></pre>

<p>thos BYTE arrays represents image that i want to load in memory from a dll, i can access them separately with no difficulty, but i want to access them from a loop with a pointer ...</p>

<p>i tried to put them into an array of array like this :</p>

<pre><code>BYTE* c[2] = {a,b};
</code></pre>

<p>but when i want to loop through this pointer c[i] doesent load image at i index into memory, how could i fix it?</p>

<p>im trying to draw images with this method within a loop to avoid repating lines ( consider c is images[i])</p>

<pre><code>void MenuIcon::drawIcons(LPDIRECT3DDEVICE9 npDevice)
{
    isMenuVisible = (Pos.x &lt; 100) &amp;&amp; (Pos.x &gt; 0)?  true : false;

    if(isMenuVisible)
    for (int i = 0; i &lt; 2; i++)
    {
        if (icon[i].img == NULL)D3DXCreateTextureFromFileInMemory(npDevice, &amp;images[i], sizeof(images[i]), &amp;icon[i].img);
        DrawTexture(icon[i].coord.x, icon[i].coord.y, icon[i].img);
    }

}
</code></pre>

<p>i try to use my method like this after reading your answer :</p>

<pre><code> void MenuIcon::drawIcons(LPDIRECT3DDEVICE9 npDevice)
{
    isMenuVisible = (Pos.x &lt; 100) &amp;&amp; (Pos.x &gt; 0)?  true : false;

    if(isMenuVisible)
    for (size_t i = 0; i &lt; images.size(); i++)
    {

        std::vector&lt;BYTE&gt;&amp; curArray = images[i];
        if (icon[i].img == NULL)D3DXCreateTextureFromFileInMemory(npDevice, &amp;curArray, curArray.size(), &amp;icon[i].img);
        DrawTexture(icon[i].coord.x, icon[i].coord.y, icon[i].img);
    }

}
</code></pre>

<p>but it still not drawing nothing .... maybe <code>&amp;curArray</code> is not called proprely?? NB -> i logged both image and size of arrayofarray and it return me correct values....</p>