title: C++ Array Pointers Error cannot convert ‘int*’ to ‘int**’
body: <p>I'm writing a program that has to use dynamic allocation to edit elements of an array. I got my first subprogram to work but whenever I try to run the second one i get an error that says </p>
  
  <blockquote>
    <p>error: cannot convert ‘int*’ to ‘int**’ for argument ‘2’ to ‘void crossout(int, int**, int)’
         crossout(5,thearr,2);</p>
  </blockquote>
  
  <pre><code>int* arr(int size);
  void crossout(int size, int* arr[], int factor);
  
  int main()
  {
      int* thearr= arr(5);
  
      thearr=crossout(5,thearr,2);
  
      for(int ix=0; ix&lt;5; ++ix){
          cout&lt;&lt;thearr[ix]&lt;&lt;"  ";
      }
  
     return 0;
  }
  
  int* arr(int size){
      int *thearray= new int[size];
  
      for(int ix=0;ix&lt;size;++ix){
          if(ix&gt;1)
              thearray[ix]=0;
          else
              thearray[ix]=-1;
      }
      return thearray;
  }
  
  
  void crossout(int size, int* arr[], int factor){
      *arr[factor]=1;
      for(int ix=factor*factor;ix&lt;size; ix * factor){
          *arr[ix]=-1;
      }
  }
  </code></pre>
  
  <p>What is the correct way to use pointers in this situation to avoid this error?</p>