Why do I get an "Access violation reading location" error with this code?
<p>Can anyone tell me why I get "Access violation reading location " with this code example? And how can i fix this?</p>

<pre><code>#include &lt;vector&gt;
using namespace std;
struct StructTest;
struct Struct1;
typedef struct Struct1{
    StructTest* test;
} Struct1;

typedef struct StructTest{
    vector&lt;Struct1*&gt; test123;
} StructTest;

static StructTest* abc;

int test(){
    abc = (StructTest*) malloc(sizeof(StructTest));;
    Struct1* a1 = (Struct1*) malloc(sizeof(Struct1));
    a1-&gt;test = abc;
    abc-&gt;test123.push_back(a1);
    return 0;
}

int main(){
    test();
    return 0;
}
</code></pre>
