Pergunta de entrevista da empresa Leidos

Give a reason why you may need to dynamically allocate memory.

Resposta da entrevista

Sigiloso

7 de ago. de 2025

If the data you are storing is quite large, there may not be enough space on the stack, where statically allocated memory resides. In this case, you can dynamically allocate memory on the heap, which typically has much more space available at runtime.