Professional Documents
Culture Documents
Answer
A memory leak is the effect of running out of memory.
A memory leak is what happens when you forget to free a block of memory allocated
with the new operator or when you make it impossible to so.
Be sure you have a pointer to each dynamic variable so that you do not lose a location
that you need to free.
1) for implicit casts that the compiler would make automatically anyway (bool to int)
2) as a mandatory forced cast (float to int).
dynamic_cast is unique to C++. It is used at runtime when info is required to make the
proper cast. For eg, when you downcast a base class pointer to a derived class.