title: How do I initialize a pointer to an array of pointers?
body: <p>I am trying to initialize a pointer to an array of pointers.  Here's an example:</p>
  
  <pre><code>class MyClass { };
  
  // INTENT: define a pointer to an array of pointers to MyClass objects
  MyClass* (*myPointer)[];
  
  int main(void) {
  
    // INTENT: define and initialize an array of pointers to MyClass objects
    MyClass * tempArray [] = {
      new MyClass(),
      new MyClass()
    };
  
    // INTENT: make myPointer point to the array just created
    myPointer = tempArray;
  
  }
  </code></pre>
  
  <p>When I compile this I get:</p>
  
  <pre><code>./test2.cpp: In function ‘int main()’:
  ./test2.cpp:15:19: error: cannot convert ‘MyClass* [2]’ to ‘MyClass* (*)[]’ in assignment
     myPointer = tempArray;
                 ^~~~~~~~~
  </code></pre>