Archived

This topic is now archived and is closed to further replies.

memory allocating

This topic is 5967 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I have a really curious problem. When I use the D3DLVERTEX structure, I can initialize my array like this: D3DLVERTEX** VertexField; VertexField=new D3DLVERTEX*[SIZE]; for(i=0;i=new D3DLVERTEX[SIZE]; } But when I use just the datatype float, my program finishes: float** VertexField; VertexField=new float*[SIZE]; for(i=0;i

Share this post


Link to post
Share on other sites
1) Use source tags [ source ] and [ /source ] (without the spaces) when you include code here so we can see it properly.

2) What''s the problem? Both of those look correct--they each allocate a SIZE-by-SIZE matrix of values.

3) "But when I use just the datatype float, my program finishes". Meaning what? Do you mean the other way doesn''t finish? Or by finish do you mean it crashes?

Both of these loops look fine to me. Either I''m missing something, or the problem (which would be what?) is not in the code you''ve listed.

Share this post


Link to post
Share on other sites