This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Array length changeable during Run - Time

Hi everyone

Does someone know how to change the length
of on array during the run time execution?
I mean how can I request memory to use
it for a array? Is there somthing like
malloc()?

Thanks!

Parents
  • "You will probably be better off allocating maximum array size at compile time."

    Yes.

    Think about it: even if you do use malloc (or similar) you will have to define the size of the "pool" from which this allocates its memory - so you will need to know the maximum array size at compile time anyway.

    So why waste your time, and the compiler's, and some CPU run time with dynamic allocation?

    Just Don't Do It!

Reply
  • "You will probably be better off allocating maximum array size at compile time."

    Yes.

    Think about it: even if you do use malloc (or similar) you will have to define the size of the "pool" from which this allocates its memory - so you will need to know the maximum array size at compile time anyway.

    So why waste your time, and the compiler's, and some CPU run time with dynamic allocation?

    Just Don't Do It!

Children
No data