What is the equivalent of C's double pointers in C++? : <p>I am a C/C++ newbie, so sorry if my question seems straightforward. </p>

<p>It has always been claimed that pointers in C++ are useless. See for example the answer from Konrad Rudolph here <a href="https://softwareengineering.stackexchange.com/questions/56935/why-are-pointers-not-recommended-when-coding-with-c">https://softwareengineering.stackexchange.com/questions/56935/why-are-pointers-not-recommended-when-coding-with-c</a></p>

<p>Below I have an example for which I am wondering how can I replace the C code by a C++ code without using any pointers:</p>

<pre><code>  double *A;                              
  double **a;

  A=new(std::nothrow) double[4];

  a=new(std::nothrow) double*[2];

for (unsigned int q=0, k=0; k &lt; 2; k++)
    {
        a[k]=A + q;
        q+=2;
    }

  delete[] A;
 delete[] a;
</code></pre>

<p>The programmer codes up as above because he/she needs the pointer <code>a</code> to point to the pointer <code>A</code> so that when modifying the variable to which <code>A</code> points, he/she does not to modify <code>a</code>.</p>

<p>Sometimes, the programmer does a <code>for loop</code> with a[k] from k={0,1,2,3}, and sometimes he does a double <code>for loop</code> a[i][j] from i,j={0,1}.</p>

<p>How can I replace this by a C++ code without using pointers? </p>
