C++ Regarding assigning value to Vector<Point> myVariable
<p>C++ Regarding assigning value to Vector myVariable</p>

<p>Hi guys.</p>

<p>I have this struct </p>

<pre><code>struct Point
{
int x,y;
}
</code></pre>

<p>and in my main.cpp i got something like this</p>

<pre><code>int main()
{
vector&lt;Point&gt; myPoints;

myPoints[0].x = 1;
myPoints[0].y = 1;

myPoints[1].x = 2;
myPoints[1].x = 2;

return 0;
}
</code></pre>

<p>and i get segmentation core dump, what is wrong with setting value to the element of the vector.</p>

<p><strong>Thanks for guiding!</strong></p>
