title: How to pass an array from a c++ library to c#
body: <p>I'm writing a plugin for <a href="http://google.github.io/liquidfun/" rel="nofollow">this</a> c++ physics library for Unity3d. The library is a superset of Box2D with particle simulation added.
  In the c++ library there is a function that returns an array of 2d vector objects for all the particles.
  I'm wondering how I could pass this back to Unity so I can draw them? I Cant pass objects between the library and Unity. Could I pass a 2d array of floats? I heard that I should instantiate an array of the correct size in Unity in c#, then pass it to the c++ function where all the data will be filled in, then pass it back to Unity (this is to help avoid memory problems in c++) How would you write this in c++?
  Alternatively could I use an out paramater to do this? And how would you write that?</p>