Pergunta de entrevista da empresa Computools

Can you explain the difference between stack and heap memory in C++, and when would you use each?