Sunday, 15 February 2015

Why are reference types not destroyed immediately like value types? -


Many tutorials say that reference types are made on a heap and only the final reference can be destroyed after it disappears.

By contrast, price types are created on the stack and automatically disappear after leaving the scope. This information can be found in many publications.

But I could not understand the reason that the reference types are not destroyed in the case of price types only.

How do you know in a context and the type is out of scope?


No comments:

Post a Comment