Stumped at a simple segmentation fault. C++
<p>Could somebody be kind to explain why in the world this gives me a segmentation fault error?</p>

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

using namespace std;

vector &lt;double&gt;freqnote;

int main(){

freqnote[0] = 16.35;

cout &lt;&lt; freqnote[0];

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

<p>I had other vectors in the code and this is the only vector that seems to be giving me trouble.</p>

<p>I changed it to <code>vector&lt;int&gt;freqnote;</code> and changed the value to 16 and I STILL get the segmentation fault. What is going on?</p>

<p>I have other vector ints and they give me correct results.</p>
