title: How do you create a vector of linked lists in C++?
body: <p>I declared a vector of linked list (and the linked lists hold <code>int</code> values). Then I tried to push a value onto the linked list (<code>i</code> is just a position in the vector):</p>
  
  <pre><code>vector&lt; list&lt;int&gt; &gt; linkedListVector;
  adjacencyVector[i].push_back(s);
  </code></pre>
  
  <p>The problem is that I run into a segmentation fault when I run the above command and I don't know why. I looked up the C++ documentation and my formatting looks correct. Any ideas?</p>