title: How can I pass a pointer to an integer in C#
body: <p>I have a C API with the signature:</p>
  
  <pre><code>int GetBuffer(char* buffer, int* maxSize)
  </code></pre>
  
  <p>In C, I will call it this way:</p>
  
  <pre><code>char buffer[4096];
  int maxSize = 4096;
  GetBuffer(buffer, &amp;maxSize);
  </code></pre>
  
  <p>maxSize is set to the buffer size, and set with the actual size filled.</p>
  
  <p>I need to call it from C#. How do I do that under "safe mode"?</p>