Matrix of lists
<p>I have two structures </p>

<pre><code>struct Edge{
        int v1;
    int v2;
        int weigt;

    Edge(int v1_tmp, int v2_tmp, int weight_tmp);
};

struct GraphList{
        int V;
    int E;
    list&lt;Edge&gt;* mylist;
}

GraphList::GraphList(GrafMatrix* graph){
    V=graph-&gt;V;
    E=graph-&gt;E;

    for (int i=0; i&lt;V; i++){
        for (int j=0; j&lt;V; j++){
            if (graph-&gt;matrix[i][j]==1) mylist[i].push_back( Edge(i+1, j+1, graf-&gt;weights[i][j]) );
        }
    }
}
</code></pre>

<p>What's wrong? When <code>i=0</code> and <code>j=1</code>, there's an  error. I tried <code>lista = new list&lt;Krawedz&gt;()</code> but it doesn't work. Any ideas?</p>
