Posted By: Gerrit
When (and how) tu use malloc? - 02/17/09 19:13
I use a couple of arrays in my program. The game consists of several levels and when I run one level at a time (to speedup design) I don't have a problem. However when I plug all the levels together code that was running perfectly before now gives me an error when using arrays. (Error E1513) The error occurs when I manipulate the following arrays:
int pole_flags[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int pole_good[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
I also tried with var
Again, if I run the level seperately no problem only when I plug the levels into one application do I have that error.
Could I be using too much memory? And if so how do I know and how would I use malloc for these arrays?
Thanks for your help / suggestions
PS. I read about malloc and did a search on this forum but could not find a clear example how to use it, and how to free memory. Can you perhaps guide me to where I can find more (and easy) examples?
int pole_flags[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int pole_good[15] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
I also tried with var
Again, if I run the level seperately no problem only when I plug the levels into one application do I have that error.
Could I be using too much memory? And if so how do I know and how would I use malloc for these arrays?
Thanks for your help / suggestions
PS. I read about malloc and did a search on this forum but could not find a clear example how to use it, and how to free memory. Can you perhaps guide me to where I can find more (and easy) examples?