+1(803)7554847

In general when is it better to allocate an object statically on the stack as opposed to dynamically on the heap

In general when is it better to allocate an object statically on the stack as opposed to dynamically on the heap

[ad_1]

This question has 4 parts.

In general, when is it better to allocate an object statically on the stack (as opposed to dynamically on the heap)? Give an example of a programming scenario where an object should certainly be stack-allocated.

Now the opposite question: in general, when is it better to allocate an object dynamically on the heap (as opposed to the statically on the stack)? Give an example of a programming scenario where an object should certainly be heap-allocated.

In general, when is it better to use a reference over a pointer? Give an example of a programming scenario where it is certainly better to use a reference.

Now the opposite question: in general, when is it better to use a pointer over a reference? Give an example of a programming scenario where it is certainly better to use a pointer.

 
“Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!”

 

“Is this question part of your assignment? We Can Help!”

Essay Writing Service

Looking for a Similar Assignment? Our ENL Writers can help. Get your first order at 15% off!

Hi there! Click one of our representatives below and we will get back to you as soon as possible.

Chat with us on WhatsApp