Creating an array of pointers to other pointers
<p>So how would I create an array which would contain pointers to other arrays, so that I can still access the arrays that the overall array points to? I tried this:</p>

<pre><code>#include &lt;iostream&gt;

using namespace std;

int main (void)
{

bool (*arrays)[3], *arr1, *arr2, *arr3, *tempArr;

arr1 = new bool[2];
arr2 = new bool[2];
arr3 = new bool[2];

arr1[0] = arr2[0] = arr3[0] = 0;
arr1[1] = arr2[1] = arr3[1] = 1;

arrays[0] = arr1;
arrays[1] = arr2;
arrays[2] = arr3;

int n = 0;

while (n &lt;= 2) {

    tempArr = arrays[n];

    cout &lt;&lt; tempArr[0] &lt;&lt; tempArr[1] &lt;&lt; "\n";
}
}
</code></pre>

<p>Also, how would I make the overall array ("arrays") a pointer so that I can add new arrays to it? I made a preliminary function, but it doesn't work (note "paths" is the overall array):</p>

<pre><code>void addPath (void)
{

int n = getArrayLength(paths), i = 0;
bool (*newPaths)[n + 1];

while (i &lt; n) {

    newPaths[i] = paths[i];

    ++i;
}

delete [] paths;

newPaths[n] = tempPath;

paths = newPaths;
}
</code></pre>

<p>Hopefully this isn't to confusing or absurd, and thank you for your help.</p>
