title: array of pointers as function parameter
body: <p>I have a basic question on array and pointer in C/C++.</p>
  
  <p>Say I have:</p>
  
  <pre><code>Foo* fooPtrArray[4];
  </code></pre>
  
  <p>How to pass the <code>fooPtrArray</code> into a function? 
  I have tried:</p>
  
  <pre><code>int getResult(Foo** fooPtrArray){}  //  failed
  int getResult(Foo* fooPtrArray[]){} // failed
  </code></pre>
  
  <p>How can I deal with pointer array?</p>
  
  <p><strong>EDIT:</strong>  I once thought the error msg is from passing the wrong pointer array, but from all the responses, I realize that it's something else... (pointer assignment) </p>
  
  <pre><code>Error msg:
  Description Resource Path Location Type incompatible types in assignment of 
  `Foo**' to `Foo*[4]' tryPointers.cpp tryPointers line 21 C/C++ Problem
  </code></pre>
  
  <p>I don't quite get why it says: Foo* * to Foo*[4]. If as function parameter they are inter-change with each other, why during assignment, it give me compilation error?</p>
  
  <p>I tried to duplicate the error msg with minimum code as follows:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  struct Foo
  {
  int id;
  };
  
  void getResult(Foo** fooPtrArray)
  {
  cout &lt;&lt; "I am in getResult" &lt;&lt; endl;
  Foo* fooPtrArray1[4];
  fooPtrArray1 = fooPtrArray;
  }
  
  int main()
  {
  Foo* fooPtrArray[4];
  getResult(fooPtrArray);
  }
  </code></pre>