C++ -- Get internal pointer to a vector
<p>I use the following method to get an allocated memory space without worrying about how to reclaim the allocated resource.</p>

<pre><code>#include &lt;vector&gt;

using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
    vector&lt;int&gt; vecInts;

    for(int iInd=0; iInd&lt;10; i++)
        vecInts.push_back(iInd);

    int* pInt = &amp;vecInts[0]; // Is this a good method?

    // now can I use pInt to modify the value of the vecInts?
    // I will NOT resize the vector and just simply manipulate the values inside
    return 0;
}
</code></pre>

<p>However, I am not sure whether such a method is a good one or not.</p>

<p>Thank you</p>
