Passing a vector pointer as input to a method
<p>I need to identify what properties(strings) are processed by a method. So, I have designed my method as below.</p>

<pre><code>void method1( std::vector&lt;String&gt; * myVector )
{
   myVector = new std::vector&lt;String&gt;();  
   //do something;
   myVector-&gt;push_things;
}
</code></pre>

<p>So, I would call method1 from topMethod() like this.</p>

<pre><code>topMethod()
{
   std::vector&lt;String&gt; * aVector = 0;
   method1( aVector );
   //process aVector to identify its contents;
}
</code></pre>

<p>Now, the vector myVector in method1() is getting populated fine. But its contents are unable at the caller method i.e., topMethod(). I'm not sure how they are getting freed. I feel that I'm allocating using new, so they should ideally be present at the caller location after the call..</p>

<p>Please provide your thoughts on what is going wrong.</p>
