title: How to marshal collection in c# to pass to native (C++) code
body: <p>I am working on an enterprise application development. the entire application is developed in c++, except the UI, which is developed in c#, now its time to hookup the UI with c++ code. After detailed study i choose PInvoke in order to do so.
  All is successful, the only case where i stuck is that how can i pass collection to C++ code.
  e.g:</p>
  
  <p>C# Side Code</p>
  
  <pre><code>List&lt;string&gt; lst = new List&lt;string&gt;();
  lst.Add("1");
  lst.Add("2");
  lst.Add("3");
  lst.Add("4");
  </code></pre>
  
  <p>C++ Side Code</p>
  
  <pre><code>std::vector&lt;std::string&gt; vStr;
  </code></pre>
  
  <p>Now how do i pass lst to native C++ code </p>