Segmentation fault while trying to print size of a vector inside a structure
<p>This piece of code gives me an error</p>

<pre><code>struct state{
    int time_taken;
    vector&lt;int&gt;time_live;
    string loc_name;
    vector&lt;int&gt;loc;
};


for(int u=0;u&lt;(A[start].loc.size());u++)
{
  l=A[start].loc[1];
  if(A[l].time_taken &lt; min_time)
  { 
    min_time=A[l].time_taken;
    finish = l;
  }
}
</code></pre>

<p>This gives a segmentational fault . </p>
