Is it possible to have a member pointer to an array in a struct?
<p>Is it possible to have a member pointer to an array in a struct? I would like to do something like below:</p>

<pre><code>struct A  
{  
   int array[10];  
   int sizeOfArray;  
};  

template&lt;int size&gt;
class B  
{  

public:  

   B(int (A::*arrayLocation)[size],  
     int A::*arraySize):  
     memberArray(arrayLocation),  
     memberArraySize(arraySize))  
  {  
  }  

   void setValue(A* pobj1)  
   {  
      for(int i = 0; i &lt; pobj1-&gt;*memberArraySize; i++)  
      {  
         (pobj1-&gt;*memberArray)[i] = 1;  
      }  
   }  


private:  
  int (A::*memberArray)[size];  
  int A::*arraySize;  
};  

int main()  
{  
    A obj2;
    B&lt;10&gt; obj1(&amp;A::array, &amp;A::sizeOfArray);  
    obj1.setValue(&amp;obj2);
}
</code></pre>
