title: Passing memoryview to C function
body: <p>I have a C function declared as follows:</p>
  
  <pre><code>void getIndexOfState(long *p, long C, long G, long B, long *state);
  </code></pre>
  
  <p>Nowadays my cython wrapper code uses the buffer syntax from numpy array:</p>
  
  <pre><code>cpdef int getIndexOfState(self, np.ndarray[np.int_t, ndim=1, mode="c"] s):
      cdef long out
      getIndexOfState(&amp;out, self.C, self.G, self.B, &lt;long*&gt; s.data)
      return out
  </code></pre>
  
  <p>I want to use the new memoryview syntax, my question is, how can I pass the pointer to the data when using a memoryview?</p>
  
  <p>I tried:</p>
  
  <pre><code>cpdef int getIndexOfState(self, long[:] s):
      cdef long out
      getIndexOfState(&amp;out, self.C, self.G, self.B, s)
      return out
  </code></pre>
  
  <p>which raised the "Cannot assign type 'long[:]' to 'long *'" error when I was trying to compile the module. There is any way to pass that pointer without coercing the memoryview back to a numpy array before calling the C function?</p>