Question d’entretien chez Entrust

What is the difference between a stack and a heap?

Réponse à la question d'entretien

Utilisateur anonyme

12 oct. 2022

The stack is used to keep track of the execution order of the program, such as functions. It is First In Last Out (FILO). The stack is also used for some variables such as arrays, which is why resizing, removing, and inserting array elements is an intensive task. The heap is used to store the program's memory, such as variables.