Skip to main content
Zwei.9
Associate III
April 24, 2020
Question

How to Allocate Memory to Objects Dynamically?

  • April 24, 2020
  • 1 reply
  • 657 views

​

This topic has been closed for replies.

1 reply

Jack Peacock_2
Associate II
April 24, 2020

When you enter a C procedure the local variables are dynamically allocated from the task stack. Exiting the procedure release the stack memory allocated to the objects, since they are no longer needed.

So your answer is: make all objects local in scope to a procedure. Then they will be dynamically allocated.

Jack Peacock