the code:
when compiled says: "Access violation writing location" on the HenonList[900].x = 5; lineCode:struct Vertex { float x, y, z; // Position of vertex in 3D space RGBquad color; // Color of vertex }; Vertex *HenonList; foo() { HenonList = (Vertex*)malloc(rits * sizeof(Vertex*)); if(HenonList == NULL) exit(1); HenonList[900].x = 5; }
But I don't understand how come? I malloc'd correctly right?