title: How to convert a (long *) to a 2 dimensional array of longs
body: <p>I have the following code in C where <code>G</code> is a global variable:</p>
  
  <pre><code>long *G;
  
  int function(long matrix[35][10]){
      G=&amp;matrix[0][0];
  }
  </code></pre>
  
  <p>Once I store the address of <code>matrix[0][0]</code> in <code>G</code>, I can access all the elements of <code>matrix</code> like so:</p>
  
  <pre><code>G[0]=...
  G[1]=...
  .
  .
  .
  G[349]=...
  </code></pre>
  
  <p>I want to be able to access all of these elements similar to how I can with <code>matrix</code>, by using the two square brackets from inside of another function. How would I be able to do that? That is, how can I tell the compiler that the offset for the second dimension in this 2 dimensional array is 10?</p>
  
  <hr>
  
  <p>I did look at this answer:
  <a href="https://stackoverflow.com/questions/1052818/create-a-pointer-to-two-dimensional-array">Create a pointer to two-dimensional array</a>
  , but I'm not sure if the user asked the exact same thing. Please correct me if I'm wrong</p>