title: How to write accessor for 2D array (private member)
body: <p>I have a private member of class called mat[3][3], and I want to be able to  access this 3x3 array outside of my class (only read it, not change). Is it possible to write accessor method that returns pointer to my array? How can I do this? Please provide code sample.</p>
  
  <p>Here is my class:</p>
  
  <pre><code>class myClass {
  private:
      int mat[3][3];
  public:
      return_value get_mat(void);
  };
  </code></pre>
  
  <p>I know I can use something like </p>
  
  <pre><code>int get_mat(int i, int j);
  </code></pre>
  
  <p>to access every int inside the array one by one, but wouldn't it be inefficient to call the accessor for every member of the array?</p>