Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


memory allocating


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 kudi   Members   -  Reputation: 244

Like
Likes
Like

Posted 09 August 2001 - 10:19 PM

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 {
VertexField=new D3DLVERTEX[SIZE];
}

But when I use just the datatype float, my program finishes:

float** VertexField;

VertexField=new float*[SIZE];
for(i=0;i {
VertexField[i]=new float[SIZE];
}


Both is actually the same and in my program I just allocate memory, but I never use these arrays. So what could be the problem?


Sponsor:

#2 Stoffel   Members   -  Reputation: 250

Like
Likes
Like

Posted 10 August 2001 - 04:10 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS