Pergunta de entrevista da empresa Solace

What is the difference between a memory stack and a memory heap?

Resposta da entrevista

Sigiloso

24 de out. de 2017

Stack are objects or variables defined within a scope that will soon be exited, thus inaccessible from elsewhere in the program I.e variables defined inside a loop. The compiler knowsbthis. Heap are objects or variables that you have access to on a larger scale, initialized with the new keyword in c++ if my memory serves me correct, or as static.